]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Assert that DBUS_SERVER_LISTEN_ADDRESS_ALREADY_USED does not set error
authorSimon McVittie <smcv@collabora.com>
Mon, 9 Jul 2018 16:06:22 +0000 (17:06 +0100)
committerSimon McVittie <smcv@collabora.com>
Thu, 2 Aug 2018 16:08:05 +0000 (17:08 +0100)
The only place this is set in practice is in dbus-server-win.c, which
does not set the error. If it did, dbus_server_listen() would leak it.

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 d91df8325cd70ed9557d7f3dc90dc0804b773caa..f26a8f7c1548b1ae3b3a3847beffcf36cb3fee61 100644 (file)
@@ -595,6 +595,7 @@ dbus_server_listen (const char     *address,
           else if (result == DBUS_SERVER_LISTEN_ADDRESS_ALREADY_USED)
             {
               _dbus_assert (server == NULL);
+              _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
               dbus_set_error (error,
                        DBUS_ERROR_ADDRESS_IN_USE,
                        "Address '%s' already used",