From: Simon McVittie Date: Tue, 21 Nov 2017 14:39:58 +0000 (+0000) Subject: _dbus_server_new_for_tcp_socket: Don't pile up errors on OOM X-Git-Tag: dbus-1.13.0~82 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d48d31cc21f8b4b9f976304d5cd8672c0e34720d;p=thirdparty%2Fdbus.git _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 Reviewed-by: Philip Withnall Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89104 --- diff --git a/dbus/dbus-server-socket.c b/dbus/dbus-server-socket.c index 460b535ca..7d9aea1a9 100644 --- a/dbus/dbus-server-socket.c +++ b/dbus/dbus-server-socket.c @@ -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);