From 32279c5c0e9612d1baeec05fd460caaee0f46505 Mon Sep 17 00:00:00 2001 From: Romain Pokrzywka Date: Sun, 8 Aug 2010 23:54:35 +0200 Subject: [PATCH] fix socket descriptor leak in _dbus_connect_tcp_socket_with_nonce --- dbus/dbus-sysdeps-win.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index aad342c..7f9d559 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -1294,6 +1294,7 @@ _dbus_connect_tcp_socket_with_nonce (const char *host, dbus_set_error (error, _dbus_error_from_errno (errno), "Unknown address family %s", family); + closesocket (fd); return -1; } hints.ai_protocol = IPPROTO_TCP; @@ -1314,6 +1315,9 @@ _dbus_connect_tcp_socket_with_nonce (const char *host, return -1; } + closesocket (fd); + fd = -1; + tmp = ai; while (tmp) { -- 1.6.5.1.1367.gcd48