mirror of
https://github.com/curl/curl.git
synced 2026-08-25 10:23:34 +03:00
close the socket properly when returning error due to failing localbind
Bug report #1124588 by David
This commit is contained in:
parent
85baebd0d4
commit
176981b529
1 changed files with 3 additions and 1 deletions
|
|
@ -640,8 +640,10 @@ 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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue