aboutsummaryrefslogtreecommitdiff
path: root/lib/connect.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/connect.c')
-rw-r--r--lib/connect.c3
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;