From 082f6e61b611efd35fbbd437e5741729244773ca Mon Sep 17 00:00:00 2001 From: Gilles Dartiguelongue Date: Thu, 6 Aug 2009 01:00:05 +0200 Subject: [PATCH] Do not unref dbus message if it is NULL. --- telepathy-glib/dbus.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/telepathy-glib/dbus.c b/telepathy-glib/dbus.c index 60c9e37..28fba99 100644 --- a/telepathy-glib/dbus.c +++ b/telepathy-glib/dbus.c @@ -1014,7 +1014,8 @@ _tp_dbus_daemon_get_name_owner (TpDBusDaemon *self, reply = dbus_connection_send_with_reply_and_block (dbc, message, timeout_ms, &dbus_error); - dbus_message_unref (message); + if (message) + dbus_message_unref (message); if (reply == NULL) { @@ -1026,7 +1027,8 @@ _tp_dbus_daemon_get_name_owner (TpDBusDaemon *self, "%s: %s", dbus_error.name, dbus_error.message); dbus_error_free (&dbus_error); - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); return FALSE; } @@ -1038,14 +1040,16 @@ _tp_dbus_daemon_get_name_owner (TpDBusDaemon *self, "%s: %s", dbus_error.name, dbus_error.message); dbus_error_free (&dbus_error); - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); return FALSE; } if (unique_name != NULL) *unique_name = g_strdup (name_in_reply); - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); return TRUE; } -- 1.6.3.3