From: Daniel Stenberg Date: Sat, 22 Sep 2018 20:30:02 +0000 (+0200) Subject: ftp: don't access pointer before NULL check X-Git-Tag: curl-7_62_0~146 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=30b2d07b033496931687023a559601486a8113f5;p=curl ftp: don't access pointer before NULL check Detected by Coverity. CID 1439611. Follow-up from 46e164069d1a523 --- diff --git a/lib/ftp.c b/lib/ftp.c index 270b1e5f0..a9668170c 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -3142,7 +3142,6 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status, int ftpcode; CURLcode result = CURLE_OK; char *path = NULL; - const char *path_to_use = ftp->path; if(!ftp) return CURLE_OK; @@ -3194,7 +3193,7 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status, if(!result) /* get the "raw" path */ - result = Curl_urldecode(data, path_to_use, 0, &path, NULL, TRUE); + result = Curl_urldecode(data, ftp->path, 0, &path, NULL, TRUE); if(result) { /* We can limp along anyway (and should try to since we may already be in * the error path) */