aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/socketpair.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/socketpair.c b/lib/socketpair.c
index 5dd9f27e9..ffdfdad7f 100644
--- a/lib/socketpair.c
+++ b/lib/socketpair.c
@@ -89,8 +89,6 @@ int Curl_socketpair(int domain, int type, int protocol,
if(socks[1] == CURL_SOCKET_BAD)
goto error;
- sclose(listener);
-
/* verify that nothing else connected */
msnprintf(data[0], sizeof(data[0]), "%p", socks);
dlen = strlen(data[0]);
@@ -100,6 +98,8 @@ int Curl_socketpair(int domain, int type, int protocol,
goto error;
if(memcmp(data[0], data[1], dlen))
goto error;
+
+ sclose(listener);
return 0;
error: