diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-10-25 13:15:11 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-10-25 13:15:11 +0000 |
commit | 9e0882ba98feff82f4ffa1f8701cdc139bbcd0f1 (patch) | |
tree | ecd92b9ad5d6f1164afb1bed57a87d8eb86d2ed7 | |
parent | c890149c8c144e6eb226d4ebf1723d203e1859ff (diff) |
close the existing socket when trying next IP, as otherwise we leak one!
bug #1326306
-rw-r--r-- | lib/connect.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/connect.c b/lib/connect.c index 23c192c7d..18c40f9ac 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; |