From ba67f7d65a42e63eccfe0bcc87f82682d6e4cc9e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 24 Apr 2018 11:33:29 +0200 Subject: mime: avoid NULL pointer dereference risk Coverity detected, CID 1435120 Closes #2527 --- lib/mime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3