1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-25 01:28:51 -05:00

ftp: don't access pointer before NULL check

Detected by Coverity. CID 1439611.

Follow-up from 46e164069d
This commit is contained in:
Daniel Stenberg 2018-09-22 22:30:02 +02:00
parent d5cbbe8397
commit 30b2d07b03
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -3142,7 +3142,6 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
int ftpcode; int ftpcode;
CURLcode result = CURLE_OK; CURLcode result = CURLE_OK;
char *path = NULL; char *path = NULL;
const char *path_to_use = ftp->path;
if(!ftp) if(!ftp)
return CURLE_OK; return CURLE_OK;
@ -3194,7 +3193,7 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
if(!result) if(!result)
/* get the "raw" path */ /* 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) { if(result) {
/* We can limp along anyway (and should try to since we may already be in /* We can limp along anyway (and should try to since we may already be in
* the error path) */ * the error path) */