All of lore.kernel.org
 help / color / mirror / Atom feed
From: Santiago Carot-Nemesio <sancane@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Santiago Carot-Nemesio <sancane@gmail.com>
Subject: [PATCH 4/4] hdp.c: Fix memory leak aborting data channel connections
Date: Wed, 14 Dec 2011 11:11:52 +0100	[thread overview]
Message-ID: <1323857512-5626-4-git-send-email-sancane@gmail.com> (raw)
In-Reply-To: <1323857512-5626-3-git-send-email-sancane@gmail.com>

Use GDestroyNotify function to decrease the reference counter of
the data channel provided in the callback when abort operation is
invoked in MCAP.
---
 health/hdp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/health/hdp.c b/health/hdp.c
index cf6ec76..db715f5 100644
--- a/health/hdp.c
+++ b/health/hdp.c
@@ -1780,8 +1780,8 @@ fail:
 	/* Send abort request because remote side is now in PENDING */
 	/* state. Then we have to delete it because we couldn't */
 	/* register the HealthChannel interface */
-	if (!mcap_mdl_abort(mdl, abort_and_del_mdl_cb, mcap_mdl_ref(mdl), NULL,
-								&gerr)) {
+	if (!mcap_mdl_abort(mdl, abort_and_del_mdl_cb, mcap_mdl_ref(mdl),
+				(GDestroyNotify) mcap_mdl_unref, &gerr)) {
 		error("%s", gerr->message);
 		g_error_free(gerr);
 		mcap_mdl_unref(mdl);
-- 
1.7.8


  reply	other threads:[~2011-12-14 10:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-14 10:11 [PATCH 1/4] hdp.c: Delay ChannelConnected signal Santiago Carot-Nemesio
2011-12-14 10:11 ` [PATCH 2/4] mcap_sync.c: Fix include paths Santiago Carot-Nemesio
2011-12-14 10:11   ` [PATCH 3/4] hdp.c: " Santiago Carot-Nemesio
2011-12-14 10:11     ` Santiago Carot-Nemesio [this message]
2011-12-15 11:59   ` [PATCH 2/4] mcap_sync.c: " Johan Hedberg
2011-12-15 12:57     ` Santiago Carot
2011-12-15 14:15 ` [PATCH 1/4] hdp.c: Delay ChannelConnected signal Johan Hedberg

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=1323857512-5626-4-git-send-email-sancane@gmail.com \
    --to=sancane@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.