From: Anderson Lizardo <anderson.lizardo@openbossa.org>
To: linux-bluetooth@vger.kernel.org
Cc: Anderson Lizardo <anderson.lizardo@openbossa.org>
Subject: [PATCH BlueZ] attrib: Fix memory leak on watcher exit
Date: Thu, 8 Mar 2012 16:01:56 -0400 [thread overview]
Message-ID: <1331236916-27596-1-git-send-email-anderson.lizardo@openbossa.org> (raw)
The "destroy" callback of g_dbus_add_disconnect_watch() is actually
never called, therefore the watcher data should be freed on
watcher_exit().
---
attrib/client.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/attrib/client.c b/attrib/client.c
index 60cff01..e6cd3dc 100644
--- a/attrib/client.c
+++ b/attrib/client.c
@@ -212,6 +212,7 @@ static void watcher_exit(DBusConnection *conn, void *user_data)
DBG("%s watcher %s exited", gatt->path, watcher->name);
gatt->watchers = g_slist_remove(gatt->watchers, watcher);
+ watcher_free(watcher);
}
static int characteristic_set_value(struct characteristic *chr,
@@ -355,7 +356,7 @@ static DBusMessage *register_watcher(DBusConnection *conn,
watcher->gatt = gatt;
watcher->path = g_strdup(path);
watcher->id = g_dbus_add_disconnect_watch(conn, sender, watcher_exit,
- watcher, watcher_free);
+ watcher, NULL);
if (gatt->attioid == 0)
gatt->attioid = btd_device_add_attio_callback(gatt->dev,
--
1.7.5.4
next reply other threads:[~2012-03-08 20:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-08 20:01 Anderson Lizardo [this message]
2012-03-08 23:53 ` [PATCH BlueZ] attrib: Fix memory leak on watcher exit Johan Hedberg
2012-03-09 2:32 ` Anderson Lizardo
2012-03-14 14:45 ` Anderson Lizardo
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=1331236916-27596-1-git-send-email-anderson.lizardo@openbossa.org \
--to=anderson.lizardo@openbossa.org \
--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).