summaryrefslogtreecommitdiff
path: root/gdbus
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-04-10 15:54:37 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-04-12 19:06:46 +0300
commit265a1a7708c732a5219b12303f70b693d9f0f53e (patch)
tree51a845fb3f3c574ebdd1b92979fa84b8264ca292 /gdbus
parent6a920ea803612b0d45865b5ad15a22ffc55d6802 (diff)
downloadbluez-265a1a7708c732a5219b12303f70b693d9f0f53e.tar.gz
gdbus: Close private connection if setup fails
Private connection should be properly closed with dbus_connection_close otherwise libdbus exits with the following error: 'The last reference on a connection was dropped without closing the connection. This is a bug in an application. See dbus_connection_unref() documentation for details. Most likely, the application was supposed to call dbus_connection_close(), since this is a private connection.'
Diffstat (limited to 'gdbus')
-rw-r--r--gdbus/mainloop.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gdbus/mainloop.c b/gdbus/mainloop.c
index 3e88eac86..b90a8447c 100644
--- a/gdbus/mainloop.c
+++ b/gdbus/mainloop.c
@@ -322,6 +322,7 @@ DBusConnection *g_dbus_setup_private(DBusBusType type, const char *name,
return NULL;
if (setup_bus(conn, name, error) == FALSE) {
+ dbus_connection_close(conn);
dbus_connection_unref(conn);
return NULL;
}