summaryrefslogtreecommitdiff
path: root/src/shared/dbus-common.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-09-10 09:38:49 +0200
committerLennart Poettering <lennart@poettering.net>2012-09-10 09:38:49 +0200
commit3137e0bd5290fea67e52cfe7ff657c3af400b548 (patch)
treebe69e8e3857913887df1e39b51922fbc755c865a /src/shared/dbus-common.c
parent680258b112e8a78769a42abb71ada4981ce701e1 (diff)
dbus: minor coding style fixes
Diffstat (limited to 'src/shared/dbus-common.c')
-rw-r--r--src/shared/dbus-common.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/shared/dbus-common.c b/src/shared/dbus-common.c
index 8d7c4620ce..bcbef77b53 100644
--- a/src/shared/dbus-common.c
+++ b/src/shared/dbus-common.c
@@ -1278,14 +1278,12 @@ int bus_method_call_with_reply(DBusConnection *bus,
va_start(ap, first_arg_type);
if (!dbus_message_append_args_valist(m, first_arg_type, ap)) {
va_end(ap);
- dbus_message_unref(m);
r = log_oom();
goto finish;
}
va_end(ap);
reply = dbus_connection_send_with_reply_and_block(bus, m, -1, &error);
- dbus_message_unref(m);
if (!reply) {
if (!return_error)
log_error("Failed to issue method call: %s", bus_error_message(&error));
@@ -1299,13 +1297,18 @@ int bus_method_call_with_reply(DBusConnection *bus,
r = -EIO;
goto finish;
}
+
if (return_reply)
*return_reply = reply;
else
dbus_message_unref(reply);
+
finish:
- if(return_error)
- *return_error=error;
+ if (m)
+ dbus_message_unref(m);
+
+ if (return_error)
+ *return_error = error;
else
dbus_error_free(&error);