From 1693eee69fed444b62ecd871c07d3f16d0ae8fbd Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Sat, 10 Mar 2018 13:42:46 +0100 Subject: [PATCH] Windows _dbus_connect_tcp_socket_with_nonce: Simplify initialization of variable noncefileStr This optimization has been detected while comparing the related unix implemention. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61922 --- dbus/dbus-sysdeps-win.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index 9ac4f5d2..d98a22c7 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -1611,18 +1611,9 @@ _dbus_connect_tcp_socket_with_nonce (const char *host, { DBusString noncefileStr; dbus_bool_t ret; - if (!_dbus_string_init (&noncefileStr) || - !_dbus_string_append(&noncefileStr, noncefile)) - { - closesocket (fd.sock); - dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL); - return _dbus_socket_get_invalid (); - } - + _dbus_string_init_const (&noncefileStr, noncefile); ret = _dbus_send_nonce (fd, &noncefileStr, error); - _dbus_string_free (&noncefileStr); - if (!ret) { closesocket (fd.sock); -- 2.12.3