From: Steve Grubb <sgrubb@redhat.com>
To: linux-bluetooth@vger.kernel.org
Subject: [Bluez PATCH 4/6] Fix leaks in profiles
Date: Wed, 12 May 2021 17:37:50 -0400 [thread overview]
Message-ID: <20210512173750.63ef39a5@ivy-bridge> (raw)
g_new0 allocates memory that must be freed
Signed-off-by: Steve Grubb <sgrubb@redhat.com>
---
profiles/audio/avrcp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index c6a342ee3..58d30b24d 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -3508,8 +3508,10 @@ static struct avrcp_player *create_ct_player(struct avrcp *session,
path = device_get_path(session->dev);
mp = media_player_controller_create(path, id);
- if (mp == NULL)
+ if (mp == NULL) {
+ g_free(player);
return NULL;
+ }
media_player_set_callbacks(mp, &ct_cbs, player);
player->user_data = mp;
--
2.31.1
next reply other threads:[~2021-05-12 22:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-12 21:37 Steve Grubb [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-05-14 14:00 [Bluez PATCH 4/6] Fix leaks in profiles Steve Grubb
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=20210512173750.63ef39a5@ivy-bridge \
--to=sgrubb@redhat.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;
as well as URLs for NNTP newsgroup(s).