From ed21c4797ba12dbc63ec8d237b758baac124ccbe Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 26 Jul 2023 12:36:21 -0700 Subject: [PATCH] bap: Fix memory leaks This fixes the following memory leaks on exit: g32 bytes in 1 blocks are definitely lost in loss record 170 of 800 g at 0x484182F: malloc (vg_replace_malloc.c:431) g by 0x47C942: util_malloc (util.c:46) g by 0x47AD6A: queue_new (queue.c:47) g by 0x379CB6: bap_data_new (bap.c:1565) g by 0x379E24: bap_probe (bap.c:1757) g by 0x4048F3: service_probe (service.c:153) g by 0x4190D5: probe_service (device.c:4817) g by 0x41927D: dev_probe (device.c:4836) g by 0x403918: btd_profile_foreach (profile.c:740) g by 0x421861: device_probe_profiles (device.c:4896) g by 0x3E5023: probe_devices (adapter.c:4590) g by 0x498022F: g_slist_foreach (in /usr/lib64/libglib-2.0.so.0.7600.4) g g64 bytes in 2 blocks are definitely lost in loss record 556 of 800 g at 0x484182F: malloc (vg_replace_malloc.c:431) g by 0x47C942: util_malloc (util.c:46) g by 0x47AD6A: queue_new (queue.c:47) g by 0x379CB6: bap_data_new (bap.c:1565) g by 0x37DEA7: bap_adapter_probe (bap.c:1843) g by 0x3CDB51: probe_profile (adapter.c:5066) g by 0x403918: btd_profile_foreach (profile.c:740) g by 0x3F557E: adapter_register (adapter.c:9288) g by 0x3F557E: read_info_complete (adapter.c:10186) g by 0x480D91: request_complete (mgmt.c:306) g by 0x484466: can_read_data (mgmt.c:394) g by 0x4ED93F: watch_callback (io-glib.c:157) g by 0x496348B: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.7600.4) --- profiles/audio/bap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 4584264..8dc6e1b 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -136,6 +136,7 @@ static void bap_data_free(struct bap_data *data) queue_destroy(data->snks, ep_unregister); queue_destroy(data->srcs, ep_unregister); + queue_destroy(data->bcast, ep_unregister); queue_destroy(data->streams, NULL); bt_bap_ready_unregister(data->bap, data->ready_id); bt_bap_state_unregister(data->bap, data->state_id); -- 2.7.4