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 <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107194
(cherry picked from commit b14a4517a8)
This commit is contained in:
Simon McVittie 2018-07-11 16:16:38 +01:00
parent 4937a36c31
commit 9cf2d308ce

View file

@ -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;
}