From: Daniel Stenberg Date: Wed, 2 Nov 2016 06:22:27 +0000 (+0100) Subject: ftp_done: don't clobber the passed in error code X-Git-Tag: curl-7_51_0~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f81a8364618caf99b4691ffd494a9b2d4c9fb1f6;p=thirdparty%2Fcurl.git ftp_done: don't clobber the passed in error code Coverity CID 1374359 pointed out the unused result value. --- diff --git a/lib/ftp.c b/lib/ftp.c index 70bb1dbcd2..b231731182 100644 --- 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 */