[next] telepathy-salut: get_contact_status: don't unref NULL hash table

Guillaume Desmottes gdesmott at kemper.freedesktop.org
Thu Jan 30 08:14:34 PST 2014


Module: telepathy-salut
Branch: next
Commit: 7256360a178457835fc81f59e7e63a6327995574
URL:    http://cgit.freedesktop.org/telepathy/telepathy-salut/commit/?id=7256360a178457835fc81f59e7e63a6327995574

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Thu Jan 30 16:43:03 2014 +0100

get_contact_status: don't unref NULL hash table

make_presence_opt_args() can return NULL, tp_presence_status_new() is
NULL-safe but g_hash_table_unref() is not.

---

 src/connection.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/connection.c b/src/connection.c
index c4ba3be..582ecff 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -609,7 +609,8 @@ get_contact_status (GObject *obj,
 
   optional_arguments = make_presence_opt_args (presence, message);
   ps = tp_presence_status_new (presence, optional_arguments);
-  g_hash_table_unref (optional_arguments);
+  if (optional_arguments != NULL)
+    g_hash_table_unref (optional_arguments);
   return ps;
 }
 



More information about the telepathy-commits mailing list