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 11:33:29 +0200
commit5660378eec3f1d0ce743c59174bda8b94fe5779b (patch)
tree85efda36408d58bfd998bbcd756dd1707a4ec1e0
parent5c39ccd83f051de3fc803584c1405b4fb5f9f899 (diff)
downloadcurl-bagder/mime-null-dereference.tar.gz
mime: avoid NULL pointer dereference riskbagder/mime-null-dereference
Coverity detected, CID 1435120
-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;