summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2018-03-10 13:42:46 +0100
committerRalf Habacker <ralf.habacker@freenet.de>2018-03-12 18:38:19 +0100
commit64a1d59b3dfb847fa5d1d51a2ff2c68737d54c53 (patch)
tree6f507595c3630cb41a3125bb982cc7a3e184c4e1
parent9d1cdce2b4892eb2204533c8ea68466fa9dd1441 (diff)
Windows _dbus_connect_tcp_socket_with_nonce: Simplify initialization of variable noncefileStr
This optimization has been detected while comparing the related unix implemention. Reviewed-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61922
-rw-r--r--dbus/dbus-sysdeps-win.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c
index 94480f664..dede8e292 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);