summaryrefslogtreecommitdiff
path: root/gdbus
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2013-02-08 15:58:10 +0200
committerMarcel Holtmann <marcel@holtmann.org>2013-02-23 11:50:16 +0100
commit7b0b28bb41a112bba1d4f33273105ffc54f98c2b (patch)
tree5b70efb9f0390d41f049bf222d29d85f17d02aa5 /gdbus
parent93eb1e5d8eb99f182e6bc5ff8159deeecbd0b557 (diff)
gdbus: Always unreference the message in g_dbus_send_message()
A quick fix on g_dbus_send_message(), if check_signal() fails it returns FALSE without unreferencing the message as it should. This patch fixes it.
Diffstat (limited to 'gdbus')
-rw-r--r--gdbus/object.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdbus/object.c b/gdbus/object.c
index 43fb1f06..2f8ef453 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -1496,7 +1496,7 @@ DBusMessage *g_dbus_create_reply(DBusMessage *message, int type, ...)
gboolean g_dbus_send_message(DBusConnection *connection, DBusMessage *message)
{
- dbus_bool_t result;
+ dbus_bool_t result = FALSE;
if (dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_METHOD_CALL)
dbus_message_set_no_reply(message, TRUE);
@@ -1507,11 +1507,12 @@ gboolean g_dbus_send_message(DBusConnection *connection, DBusMessage *message)
const GDBusArgInfo *args;
if (!check_signal(connection, path, interface, name, &args))
- return FALSE;
+ goto out;
}
result = dbus_connection_send(connection, message, NULL);
+out:
dbus_message_unref(message);
return result;