From: Daniel Stenberg Date: Tue, 25 Oct 2005 13:15:11 +0000 (+0000) Subject: close the existing socket when trying next IP, as otherwise we leak one! X-Git-Tag: upstream/7.37.1~10829 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9e0882ba98feff82f4ffa1f8701cdc139bbcd0f1;p=platform%2Fupstream%2Fcurl.git close the existing socket when trying next IP, as otherwise we leak one! bug #1326306 --- diff --git a/lib/connect.c b/lib/connect.c index 23c192c..18c40f9 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -472,6 +472,9 @@ static bool trynextip(struct connectdata *conn, if(sockindex != FIRSTSOCKET) return TRUE; /* no next */ + /* first close the failed socket */ + sclose(conn->sock[sockindex]); + /* try the next address */ ai = conn->ip_addr->ai_next;