summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-04-24 11:33:29 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-04-24 17:11:01 +0200
commitba67f7d65a42e63eccfe0bcc87f82682d6e4cc9e (patch)
tree269a44b10931f644ddee42ce5b5edfe3f3d3ac16
parentdd7521bcc1b7a6fcb53c31f9bd1192fcc884bd56 (diff)
downloadcurl-ba67f7d65a42e63eccfe0bcc87f82682d6e4cc9e.tar.gz
mime: avoid NULL pointer dereference risk
Coverity detected, CID 1435120 Closes #2527
-rw-r--r--lib/mime.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/mime.c b/lib/mime.c
index ce56d7873..4c0d2eeba 100644
--- a/lib/mime.c
+++ b/lib/mime.c
@@ -1205,7 +1205,7 @@ CURLcode Curl_mime_duppart(curl_mimepart *dst, const curl_mimepart *src)
res = curl_mime_filename(dst, src->filename);
/* If an error occurred, rollback. */
- if(res)
+ if(res && dst)
Curl_mime_cleanpart(dst);
return res;