test_server_setup: on OOM while setting up watch/timeout, don't leak sd
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 19 Jan 2011 17:28:58 +0000 (17:28 +0000)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 21 Jan 2011 13:28:08 +0000 (13:28 +0000)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33128
Reviwed-by: Colin Walters <walters@verbum.org>
test/test-utils.c

index eda20cd..67e207c 100644 (file)
@@ -304,7 +304,7 @@ test_server_setup (DBusLoop      *loop,
                                         sd,
                                         serverdata_free))
     {
-      return FALSE;
+      goto nomem;
     }
 
   if (!dbus_server_set_timeout_functions (server,
@@ -313,7 +313,7 @@ test_server_setup (DBusLoop      *loop,
                                           NULL,
                                           sd, serverdata_free))
     {
-      return FALSE;
+      goto nomem;
     }   
   return TRUE;