ftp_do_more: add missing check of return code
authorDaniel Stenberg <daniel@haxx.se>
Fri, 13 Jul 2012 12:12:39 +0000 (14:12 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 13 Jul 2012 12:12:39 +0000 (14:12 +0200)
Spotted by clang-analyzer. The return code was never checked, just
stored.

lib/ftp.c

index 3a494535d6b964c5b9755aa3c2db0b1ab4a42449..438ccfc0f232d5b6022686487060b4c645ada49b 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -3674,8 +3674,11 @@ static CURLcode ftp_do_more(struct connectdata *conn, bool *complete)
         /* It looks data connection is established */
         result = AcceptServerConnect(conn);
         ftpc->wait_data_conn = FALSE;
-        if(result == CURLE_OK)
+        if(!result)
           result = InitiateTransfer(conn);
+
+        if(result)
+          return result;
       }
     }
     else if(data->set.upload) {