[PATCH 4/4] hdp.c: Fix memory leak aborting data channel connections

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux