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.
This commit is contained in:
Andrzej Kaczmarek 2014-01-14 17:16:19 +01:00 committed by Luiz Augusto von Dentz
parent 63ffbe33a5
commit e21b24d825

View File

@ -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);
}