From 9f83f7b8689ad3be70636410f29e5c620e66c794 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 15 Jun 2016 14:25:19 +0300 Subject: [PATCH] audio/avdtp: Fix memory leak Fixes not freeing the stream if endpoint response with an error causing the followin trace: 146 (104 direct, 42 indirect) bytes in 1 blocks are definitely lost in loss record 209 of 244 at 0x4C2A988: calloc (vg_replace_malloc.c:711) by 0x50CE580: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.4600.2) by 0x42600F: avdtp_setconf_cmd (avdtp.c:1474) by 0x42600F: avdtp_parse_cmd (avdtp.c:1966) by 0x42600F: session_cb (avdtp.c:2165) by 0x50C8E59: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.4600.2) by 0x50C91EF: ??? (in /usr/lib64/libglib-2.0.so.0.4600.2) by 0x50C9511: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.4600.2) by 0x40BFC8: main (main.c:687) --- profiles/audio/avdtp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c index 82de98b87..4ec9cca2a 100644 --- a/profiles/audio/avdtp.c +++ b/profiles/audio/avdtp.c @@ -1397,6 +1397,7 @@ static void setconf_cb(struct avdtp *session, struct avdtp_stream *stream, avdtp_send(session, session->in.transaction, AVDTP_MSG_TYPE_REJECT, AVDTP_SET_CONFIGURATION, &rej, sizeof(rej)); + stream_free(stream); return; } -- 2.47.3