summaryrefslogtreecommitdiffstats
path: root/gdbus
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-04-10 15:54:37 +0300
committerMarcel Holtmann <marcel@holtmann.org>2015-04-20 09:04:39 +0200
commita5b040b7818871a0d7e48bc1b26baa4c4f04eab4 (patch)
tree26232a39cb29c80cd086280bb2e25be54e817bed /gdbus
parent97abe1751d5351b09bf181f59e3207ea37dcdafe (diff)
downloadofono-a5b040b7818871a0d7e48bc1b26baa4c4f04eab4.tar.bz2
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 3e88eac8..b90a8447 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;
}