summaryrefslogtreecommitdiff
path: root/gdbus
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2013-02-08 13:58:10 (GMT)
committerMarcel Holtmann <marcel@holtmann.org>2013-02-23 10:50:02 (GMT)
commit90be096dda352bfa08fb5a1481ca6f3afd30db5e (patch)
tree157aef1323038250465f05aa5862d948d2c3f645 /gdbus
parentfd7df6fc7ec20c060277cd479616db4fab4972b5 (diff)
downloadconnman-90be096dda352bfa08fb5a1481ca6f3afd30db5e.zip
connman-90be096dda352bfa08fb5a1481ca6f3afd30db5e.tar.gz
connman-90be096dda352bfa08fb5a1481ca6f3afd30db5e.tar.bz2
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 43fb1f0..2f8ef45 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;