1
0
mirror of https://github.com/moparisthebest/curl synced 2025-02-28 17:31:46 -05:00

socketpair: fix double-close in error case

Follow-up to bc2dbef0afc08
This commit is contained in:
Daniel Stenberg 2019-10-10 11:18:21 +02:00
parent 1b843bb5ed
commit 622cf7db6b
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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: