From a5b040b7818871a0d7e48bc1b26baa4c4f04eab4 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 10 Apr 2015 15:54:37 +0300 Subject: [PATCH] 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.' --- gdbus/mainloop.c | 1 + 1 file changed, 1 insertion(+) 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; }