From 461b066346015907451b9eb693a293a92b1ed06e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 17 Jan 2007 23:57:24 +0000 Subject: Add missing dbus_connection_unref() calls in failure cases --- common/dbus.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common/dbus.c') 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; } } -- cgit