From 6ae5bc784631751651b1f0e12c9098916f6515f9 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 16 Sep 2013 13:35:10 +0300 Subject: [PATCH] obexd/bluetooth: Fix memory leak g_io_channel_unix_new creates a reference which is then passed to obex_session_start which creates its on reference via g_io_channel_ref leading to the following leak: at 0x4A06409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x3B03C4D89E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3) by 0x3B03C88224: g_io_channel_unix_new (in /usr/lib64/libglib-2.0.so.0.3600.3) by 0x418967: profile_new_connection (bluetooth.c:148) by 0x43D763: process_message.isra.5 (object.c:259) --- obexd/plugins/bluetooth.c | 1 + 1 file changed, 1 insertion(+) diff --git a/obexd/plugins/bluetooth.c b/obexd/plugins/bluetooth.c index 6f6ace90e..017ff6091 100644 --- a/obexd/plugins/bluetooth.c +++ b/obexd/plugins/bluetooth.c @@ -152,6 +152,7 @@ static DBusMessage *profile_new_connection(DBusConnection *conn, DBG("device %s", device); connect_event(io, NULL, data); + g_io_channel_unref(io); return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); } -- 2.47.3