From 3b3858ac23d21a59659b365fdb2d63a873c9499c 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 | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index 2788d562..b0c35270 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -1612,14 +1612,7 @@ _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); -- 2.12.3