Parent: 9e9b9d7e0cf95c291dd171d34a5e281918b7cef5
Author: Anderson Lizardo <anderson.lizardo@openbossa.org>
Committer: Johan Hedberg <johan.hedberg@intel.com>
Date: 2012-12-23 11:29:58
Tree: 0da5a24c42e325ce6e05b9d694a23cdf6c809b9e
core: Fix memory leak from pending UUID removal When bluetoothd is shutting down, profile cleanup will usually issue many "Remove UUID" management commands. These may not complete before the process exits, resulting on this memory leak: ==2461== 144 (8 direct, 136 indirect) bytes in 1 blocks are definitely lost in loss record 153 of 176 ==2461== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==2461== by 0x40869AA: standard_malloc (gmem.c:85) ==2461== by 0x4086E42: g_malloc (gmem.c:159) ==2461== by 0x409B26D: g_slice_alloc (gslice.c:1003) ==2461== by 0x409C659: g_slist_append (gslist.c:222) ==2461== by 0x80B5E12: mgmt_remove_uuid (mgmt.c:1034) ==2461== by 0x80A734E: adapter_service_remove (adapter.c:708) ==2461== by 0x80994B4: sdp_record_remove (sdpd-database.c:272) ==2461== by 0x8098CC0: remove_record_from_server (sdpd-service.c:290) ==2461== by 0x8062B5B: avrcp_unregister (avrcp.c:2354) ==2461== by 0x409C797: g_slist_foreach (gslist.c:840) ==2461== by 0x80A7D77: adapter_remove (adapter.c:1630) The leak seems to only happen during bluetoothd shutdown, because the list of pending UUIDs is cleared when controller is removed. Therefore, only cleanup the list on shutdown path.
Diffstat
| M | src/mgmt.c | | | 11 | +++++++++++ |
1 files changed, 11 insertions(+), 0 deletions(-)