From: Simon McVittie Date: Wed, 11 Jul 2018 15:16:38 +0000 (+0100) Subject: dbus_server_listen: Don't leak first_connect_error X-Git-Tag: dbus-1.13.6~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b14a4517a82f7e7e4c0b59cb663ebf77563decda;p=thirdparty%2Fdbus.git dbus_server_listen: Don't leak first_connect_error 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 Reviewed-by: Philip Withnall Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107194 --- diff --git a/dbus/dbus-server.c b/dbus/dbus-server.c index 3243af6c9..607eae949 100644 --- a/dbus/dbus-server.c +++ b/dbus/dbus-server.c @@ -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; }