1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

mime: be tolerant about setting twice the same header list in a part.

This commit is contained in:
Patrick Monnerat 2017-10-08 16:20:13 +01:00
parent 14d6e207d3
commit 93e62adde8

View File

@ -1356,6 +1356,7 @@ CURLcode curl_mime_headers(curl_mimepart *part,
return CURLE_BAD_FUNCTION_ARGUMENT; return CURLE_BAD_FUNCTION_ARGUMENT;
if(part->flags & MIME_USERHEADERS_OWNER) { if(part->flags & MIME_USERHEADERS_OWNER) {
if(part->userheaders != headers) /* Allow setting twice the same list. */
curl_slist_free_all(part->userheaders); curl_slist_free_all(part->userheaders);
part->flags &= ~MIME_USERHEADERS_OWNER; part->flags &= ~MIME_USERHEADERS_OWNER;
} }