From 53d3fc3fad5152167458625ad2acf19070cdf26a Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Sun, 27 Jan 2013 17:52:15 -0600 Subject: [PATCH] AVCTP: Fix not destroying browsing channel if disconnected If the browsing channel is disconnected it should be destroyed immediatelly and set to NULL otherwise it will point to invalid channel. --- profiles/audio/avctp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c index 6ad2b6632..6cac71808 100644 --- a/profiles/audio/avctp.c +++ b/profiles/audio/avctp.c @@ -485,6 +485,10 @@ static void avctp_set_state(struct avctp *session, avctp_state_t new_state) break; case AVCTP_STATE_CONNECTED: DBG("AVCTP Connected"); + if (session->browsing) { + avctp_channel_destroy(session->browsing); + session->browsing = NULL; + } break; case AVCTP_STATE_BROWSING_CONNECTING: DBG("AVCTP Browsing Connecting"); -- 2.47.3