summaryrefslogtreecommitdiff
path: root/android/a2dp.c
diff options
context:
space:
mode:
authorAndrzej Kaczmarek <andrzej.kaczmarek@tieto.com>2014-01-14 17:16:19 +0100
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-01-15 11:32:51 +0200
commite21b24d8258c0d3a06d19c4124a013b9c28719f9 (patch)
treeeaeb6307f709e2ae43ebcd9da28c170f82b05aae /android/a2dp.c
parent63ffbe33a5545eea9a007987d86ef7844daf141d (diff)
downloadbluez-e21b24d8258c0d3a06d19c4124a013b9c28719f9.tar.gz
android/a2dp: Fix freeing preset on SEP close
In case SEP was opened from local side, corresponding a2dp_setup structure has just reference to a2dp_preset which is stored on presets list. As a result, when closing SEP such preset will be freed leaving dangling pointer on presets list.
Diffstat (limited to 'android/a2dp.c')
-rw-r--r--android/a2dp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/android/a2dp.c b/android/a2dp.c
index 145cd6738..27360d3bd 100644
--- a/android/a2dp.c
+++ b/android/a2dp.c
@@ -647,7 +647,9 @@ static void setup_free(void *data)
{
struct a2dp_setup *setup = data;
- preset_free(setup->preset);
+ if (!g_slist_find(setup->endpoint->presets, setup->preset))
+ preset_free(setup->preset);
+
g_free(setup);
}