summaryrefslogtreecommitdiff
path: root/android/avrcp-lib.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-03-26 22:24:05 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-03-27 10:49:34 +0200
commitbe6bccef8883b62c3b5d0d66d590378165249c8e (patch)
tree8f0be77028e2e7c3d804d5870bb72bcd12719a99 /android/avrcp-lib.c
parent9aa110e7392fb4329bd1026c62839ef60bd4ef36 (diff)
downloadbluez-be6bccef8883b62c3b5d0d66d590378165249c8e.tar.gz
android/avrcp-lib: Fix test /TP/MPS/BV-06-C
This fixes the following crash on /TP/MPS/BV-06-C: Invalid write of size 4 at 0x414A98: browsing_disconnect_cb (avrcp-lib.c:652) by 0x4122B2: handler_free (avctp.c:1121) by 0x4E9C7FC: g_slist_foreach (in /usr/lib64/libglib-2.0.so.0.4200.2) by 0x4E9C81A: g_slist_free_full (in /usr/lib64/libglib-2.0.so.0.4200.2) by 0x413219: avctp_destroy_browsing (avctp.c:1130) by 0x4132B4: avctp_channel_destroy (avctp.c:499) by 0x4133E0: avctp_unref (avctp.c:729) by 0x413682: avctp_shutdown (avctp.c:1650) by 0x413682: session_cb (avctp.c:1020) by 0x4E7E7FA: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.4200.2) by 0x4E7EB97: ??? (in /usr/lib64/libglib-2.0.so.0.4200.2) by 0x4E7EEC1: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.4200.2) by 0x41D301: tester_run (tester.c:831) Address 0x57bc0e8 is 88 bytes inside a block of size 112 free'd at 0x4C2ACE9: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x4E8450E: g_free (in /usr/lib64/libglib-2.0.so.0.4200.2) by 0x419A75: avrcp_shutdown (avrcp-lib.c:382) by 0x40E77E: destroy_context (test-avrcp.c:140) by 0x40E82F: context_quit (test-avrcp.c:153) by 0x40EA01: get_folder_items_rsp (test-avrcp.c:884) by 0x415DA0: get_folder_items_rsp (avrcp-lib.c:2731) by 0x413EC1: browsing_response (avctp.c:835) by 0x413EC1: session_browsing_cb (avctp.c:883) by 0x4E7E7FA: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.4200.2) by 0x4E7EB97: ??? (in /usr/lib64/libglib-2.0.so.0.4200.2) by 0x4E7EEC1: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.4200.2) by 0x41D301: tester_run (tester.c:831)
Diffstat (limited to 'android/avrcp-lib.c')
-rw-r--r--android/avrcp-lib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/android/avrcp-lib.c b/android/avrcp-lib.c
index 23dea6232..353bee53f 100644
--- a/android/avrcp-lib.c
+++ b/android/avrcp-lib.c
@@ -367,6 +367,10 @@ void avrcp_shutdown(struct avrcp *session)
avctp_unregister_passthrough_handler(session->conn,
session->passthrough_id);
+ if (session->browsing_id > 0)
+ avctp_unregister_browsing_pdu_handler(session->conn,
+ session->browsing_id);
+
/* clear destroy callback that would call shutdown again */
avctp_set_destroy_cb(session->conn, NULL, NULL);
avctp_shutdown(session->conn);