public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ] media: Fix memory leak
Date: Tue,  9 Nov 2021 13:53:22 -0800	[thread overview]
Message-ID: <20211109215322.1124566-1-luiz.dentz@gmail.com> (raw)

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This fixes the following memory leak as a result of not freeing
app->proxies:

160 (32 direct, 128 indirect) bytes in 1 blocks are definitely lost in
loss record 218 of 261
   at 0x484086F: malloc (vg_replace_malloc.c:381)
   by 0x1CF80E: btd_malloc (util.c:33)
   by 0x1CF24D: queue_new (queue.c:47)
   by 0x144DB9: create_app (media.c:2262)
   by 0x144DB9: register_app (media.c:2322)
   by 0x1CC148: process_message (object.c:246)
---
 profiles/audio/media.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index 521902ed8..edefedc90 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -1910,6 +1910,7 @@ static void app_free(void *data)
 {
 	struct media_app *app = data;
 
+	queue_destroy(app->proxies, NULL);
 	queue_destroy(app->endpoints, media_endpoint_remove);
 	queue_destroy(app->players, media_player_remove);
 
-- 
2.31.1


             reply	other threads:[~2021-11-09 21:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-09 21:53 Luiz Augusto von Dentz [this message]
2021-11-09 22:37 ` [BlueZ] media: Fix memory leak bluez.test.bot
2021-11-09 22:46   ` Luiz Augusto von Dentz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211109215322.1124566-1-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox