From: Daniel Stenberg Date: Thu, 17 Feb 2005 14:45:03 +0000 (+0000) Subject: close the socket properly when returning error due to failing localbind X-Git-Tag: curl-7_13_1~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=176981b529bad6a61ad4a5439c87953ae5541a98;p=curl close the socket properly when returning error due to failing localbind Bug report #1124588 by David --- diff --git a/lib/connect.c b/lib/connect.c index e59e6721e..261ab08d8 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -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 */