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.12.10~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9cf2d308ce289293932d40d70005e3e4e67f64d1;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 (cherry picked from commit b14a4517a82f7e7e4c0b59cb663ebf77563decda) --- diff --git a/dbus/dbus-server.c b/dbus/dbus-server.c index d91df8325..7a1243b8a 100644 --- a/dbus/dbus-server.c +++ b/dbus/dbus-server.c @@ -680,6 +680,7 @@ dbus_server_listen (const char *address, } else { + dbus_error_free (&first_connect_error); _DBUS_ASSERT_ERROR_IS_CLEAR (error); return server; }