1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

close the socket properly when returning error due to failing localbind

Bug report #1124588 by David
This commit is contained in:
Daniel Stenberg 2005-02-17 14:45:03 +00:00
parent 85baebd0d4
commit 176981b529

View File

@ -640,9 +640,11 @@ singleipconnect(struct connectdata *conn,
/* user selected to bind the outgoing socket to a specified "device"
before doing connect */
CURLcode res = bindlocal(conn, sockfd);
if(res)
if(res) {
sclose(sockfd); /* close socket and bail out */
return res;
}
}
/* set socket non-blocking */
Curl_nonblock(sockfd, TRUE);