_dbus_server_new_for_tcp_socket: Don't pile up errors on OOM

If _dbus_noncefile_create() has failed and set error, it is incorrect
for us to set it again.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89104
This commit is contained in:
Simon McVittie 2017-11-21 14:39:58 +00:00
parent 1ecaff10da
commit d48d31cc21

View file

@ -482,8 +482,10 @@ _dbus_server_new_for_tcp_socket (const char *host,
if (use_nonce)
{
if (!_dbus_noncefile_create (&noncefile, error) ||
!_dbus_string_append (&address, ",noncefile=") ||
if (!_dbus_noncefile_create (&noncefile, error))
goto failed_2;
if (!_dbus_string_append (&address, ",noncefile=") ||
!_dbus_address_append_escaped (&address, _dbus_noncefile_get_path (noncefile)))
{
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);