gdbusserver: Fix a potential g_object_unref(NULL) call
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Tue, 26 Nov 2013 11:08:50 +0000 (11:08 +0000)
committerPhilip Withnall <philip.withnall@collabora.co.uk>
Wed, 27 Nov 2013 10:01:29 +0000 (10:01 +0000)
This can happen if the hash table lookup for ‘noncefile’ fails, and
hence the first ‘goto out’ is hit, at which point resolver is still
NULL.

Found with scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=113075

gio/gdbusserver.c

index 30df5cb66808ec7a372dbd3ebfe15e76420757ef..1016efbd213c773483a8d1e01539e553781a24e1 100644 (file)
@@ -898,7 +898,7 @@ try_tcp (GDBusServer  *server,
 
  out:
   g_list_free_full (resolved_addresses, g_object_unref);
-  g_object_unref (resolver);
+  g_clear_object (&resolver);
   return ret;
 }