diff options
author | Simon McVittie <smcv@collabora.com> | 2017-11-21 14:39:58 +0000 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2017-11-24 12:17:30 +0000 |
commit | d48d31cc21f8b4b9f976304d5cd8672c0e34720d (patch) | |
tree | 56f96a1b589913837784dc0967cffa6e02f2b060 | |
parent | 1ecaff10dab4bd9b57b466aff18a650b6a8c3c06 (diff) |
_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
-rw-r--r-- | dbus/dbus-server-socket.c | 6 |
1 files changed, 4 insertions, 2 deletions
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); |