mime: avoid NULL pointer dereference risk

Coverity detected, CID 1435120

Closes #2527
This commit is contained in:
Daniel Stenberg 2018-04-24 11:33:29 +02:00
parent dd7521bcc1
commit ba67f7d65a
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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;