diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2015-08-27 17:45:27 +0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2015-08-28 10:37:04 +0300 |
commit | cdcea1773a484767c766dccb63c32e0086d5bd4f (patch) | |
tree | f7ddab39f2a52755b156a9e368b57e578c2a580b | |
parent | 8a29308b4c581aec9042bf8fbe56f654c44ae506 (diff) | |
download | bluez-cdcea1773a484767c766dccb63c32e0086d5bd4f.tar.gz |
audio/avrcp: Fix memory leak
This frees settings list after used otherwise it leaks as follow:
48 (24 direct, 24 indirect) bytes in 1 blocks are definitely lost in loss record 152 of 239
at 0x4C28C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x4E84679: g_malloc (in /usr/lib64/libglib-2.0.so.0.4400.1)
by 0x4E9BCD2: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.4400.1)
by 0x4E7A6E5: g_list_prepend (in /usr/lib64/libglib-2.0.so.0.4400.1)
by 0x4E6E44B: g_hash_table_get_keys (in /usr/lib64/libglib-2.0.so.0.4400.1)
by 0x426D5A: list_settings (media.c:1003)
by 0x4336B4: player_list_settings (avrcp.c:1390)
by 0x4336B4: avrcp_handle_register_notification (avrcp.c:1514)
by 0x436711: handle_vendordep_pdu (avrcp.c:1827)
by 0x42EB6F: session_cb (avctp.c:1025)
by 0x4E7EA89: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.4400.1)
by 0x4E7EE1F: ??? (in /usr/lib64/libglib-2.0.so.0.4400.1)
by 0x4E7F141: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.4400.1)
-rw-r--r-- | profiles/audio/avrcp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c index 2d76f5481..fd3504c77 100644 --- a/profiles/audio/avrcp.c +++ b/profiles/audio/avrcp.c @@ -1531,6 +1531,8 @@ static uint8_t avrcp_handle_register_notification(struct avrcp *session, pdu->params[len++] = val; } + g_list_free(settings); + break; case AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED: len = 5; |