Fixes warning detected by PVS-Studio
Fixes #4374
const curl_mimepart *s;
CURLcode res = CURLE_OK;
+ DEBUGASSERT(dst);
+
/* Duplicate content. */
switch(src->kind) {
case MIMEKIND_NONE:
}
}
- /* Duplicate other fields. */
- if(dst != NULL)
+ if(!res) {
+ /* Duplicate other fields. */
dst->encoder = src->encoder;
- else
- res = CURLE_WRITE_ERROR;
- if(!res)
res = curl_mime_type(dst, src->mimetype);
+ }
if(!res)
res = curl_mime_name(dst, src->name);
if(!res)
res = curl_mime_filename(dst, src->filename);
/* If an error occurred, rollback. */
- if(res && dst)
+ if(res)
Curl_mime_cleanpart(dst);
return res;