]> granicus.if.org Git - curl/commitdiff
close the existing socket when trying next IP, as otherwise we leak one!
authorDaniel Stenberg <daniel@haxx.se>
Tue, 25 Oct 2005 13:15:11 +0000 (13:15 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 25 Oct 2005 13:15:11 +0000 (13:15 +0000)
bug #1326306

lib/connect.c

index 23c192c7db762db77f5900f5bed431c3ac1e50f6..18c40f9acf3d13e1f2b76759c46b05dca96a47a0 100644 (file)
@@ -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;