summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-09-22 22:30:02 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-09-23 23:08:36 +0200
commit30b2d07b033496931687023a559601486a8113f5 (patch)
tree2004c919dceeff74a3a70ee02d2237d2e0fd5fee
parentd5cbbe83973b8638210a6a90f250dfc0154898b3 (diff)
downloadcurl-30b2d07b033496931687023a559601486a8113f5.tar.gz
ftp: don't access pointer before NULL check
Detected by Coverity. CID 1439611. Follow-up from 46e164069d1a523
-rw-r--r--lib/ftp.c3
1 files changed, 1 insertions, 2 deletions
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) */