From 48a72b9a65e221a0c6d3eb76fc4aacf916bd869b Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 21 Nov 2017 14:39:58 +0000 Subject: [PATCH 07/12] _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 --- dbus/dbus-server-socket.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dbus/dbus-server-socket.c b/dbus/dbus-server-socket.c index 460b535c..7d9aea1a 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); -- 2.15.0