diff options
author | Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com> | 2014-01-14 17:16:19 +0100 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2014-01-15 11:32:51 +0200 |
commit | e21b24d8258c0d3a06d19c4124a013b9c28719f9 (patch) | |
tree | eaeb6307f709e2ae43ebcd9da28c170f82b05aae /android/a2dp.c | |
parent | 63ffbe33a5545eea9a007987d86ef7844daf141d (diff) | |
download | bluez-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.c | 4 |
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); } |