]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ftp_done: don't clobber the passed in error code
authorDaniel Stenberg <daniel@haxx.se>
Wed, 2 Nov 2016 06:22:27 +0000 (07:22 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 2 Nov 2016 06:22:27 +0000 (07:22 +0100)
Coverity CID 1374359 pointed out the unused result value.

lib/ftp.c

index 70bb1dbcd25bca5aa32bb1b6cc4ec5a354c9d5c5..b231731182e8692ae86ae6354f77a019372e17c4 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -3298,11 +3298,12 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
     ftpc->known_filesize = -1;
   }
 
-  /* get the "raw" path */
-  result = Curl_urldecode(data, path_to_use, 0, &path, NULL, FALSE);
+  if(!result)
+    /* get the "raw" path */
+    result = Curl_urldecode(data, path_to_use, 0, &path, NULL, FALSE);
   if(result) {
-    /* out of memory, but we can limp along anyway (and should try to
-     * since we may already be in the out of memory cleanup path) */
+    /* We can limp along anyway (and should try to since we may already be in
+     * the error path) */
     ftpc->ctl_valid = FALSE; /* mark control connection as bad */
     connclose(conn, "FTP: out of memory!"); /* mark for connection closure */
     ftpc->prevpath = NULL; /* no path remembering */