]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
dbus_server_listen: Don't leak first_connect_error
authorSimon McVittie <smcv@collabora.com>
Wed, 11 Jul 2018 15:16:38 +0000 (16:16 +0100)
committerSimon McVittie <smcv@collabora.com>
Thu, 2 Aug 2018 16:10:48 +0000 (17:10 +0100)
If an implementation fails to listen, and a subsequent implementation
succeeds, then we would have leaked this. Detected by running
tests/loopback.c under valgrind.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107194

dbus/dbus-server.c

index 3243af6c92c4b5947d26f8f2d9cc1f9328fd18a1..607eae949251407e44803a40e9fd8424b02dbde8 100644 (file)
@@ -685,6 +685,7 @@ dbus_server_listen (const char     *address,
     }
   else
     {
+      dbus_error_free (&first_connect_error);
       _DBUS_ASSERT_ERROR_IS_CLEAR (error);
       return server;
     }