]> granicus.if.org Git - curl/commitdiff
fixed a leaked file descriptor when PORT failed
authorDaniel Stenberg <daniel@haxx.se>
Tue, 19 Dec 2000 09:06:36 +0000 (09:06 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 19 Dec 2000 09:06:36 +0000 (09:06 +0000)
lib/ftp.c

index 93f1d30481940c72995e5f9d0b2821d7605265aa..a2c930d6ccbae68aa867aece9153d76c923c5b51 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -733,6 +733,12 @@ CURLcode _ftp(struct connectdata *conn)
 
     if ( h ) {
       if( (portsock = socket(AF_INET, SOCK_STREAM, 0)) >= 0 ) {
+
+        /* we set the secondary socket variable to this for now, it
+           is only so that the cleanup function will close it in case
+           we fail before the true secondary stuff is made */
+        data->secondarysocket = portsock;
+
         memset((char *)&sa, 0, sizeof(sa));
         memcpy((char *)&sa.sin_addr,
                h->h_addr,