]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
test_try_connect_to_bus: Don't leak the connection on OOM
authorSimon McVittie <smcv@collabora.com>
Mon, 27 Nov 2017 19:14:57 +0000 (19:14 +0000)
committerSimon McVittie <smcv@collabora.com>
Mon, 4 Dec 2017 11:52:40 +0000 (11:52 +0000)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100317
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
test/test-utils-glib.c

index a539c5c84e3bf1c1904c35d5166d59f4c60f2198..fd804c9679eb62a07d3c31b310c36034567220f1 100644 (file)
@@ -353,6 +353,12 @@ fail:
   if (gerror != NULL)
     *gerror = g_dbus_error_new_for_dbus_error (error.name, error.message);
 
+  if (conn != NULL)
+    {
+      dbus_connection_close (conn);
+      dbus_connection_unref (conn);
+    }
+
   dbus_error_free (&error);
   return FALSE;
 }