summaryrefslogtreecommitdiffstats
path: root/common/dbus.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-01-17 23:57:24 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-01-17 23:57:24 +0000
commit461b066346015907451b9eb693a293a92b1ed06e (patch)
tree6dfb2a0ddd87339bc353b4f83e453e50b1439749 /common/dbus.c
parentfa6cce02d57d4720af01da3cee545eb611dd890c (diff)
Add missing dbus_connection_unref() calls in failure cases
Diffstat (limited to 'common/dbus.c')
-rw-r--r--common/dbus.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/dbus.c b/common/dbus.c
index e11b94e4..730dfb67 100644
--- a/common/dbus.c
+++ b/common/dbus.c
@@ -571,12 +571,14 @@ DBusConnection *init_dbus(const char *name, void (*disconnect_cb)(void *), void
if (dbus_bus_request_name(conn, name, 0, &err) !=
DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER ) {
error("Could not become the primary owner of %s", name);
+ dbus_connection_unref(conn);
return NULL;
}
if (dbus_error_is_set(&err)) {
error("Can't get bus name %s: %s", name, err.message);
dbus_error_free(&err);
+ dbus_connection_unref(conn);
return NULL;
}
}