From: Patrick Monnerat Date: Sun, 8 Oct 2017 15:20:13 +0000 (+0100) Subject: mime: be tolerant about setting twice the same header list in a part. X-Git-Tag: curl-7_56_1~52 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=93e62adde88b6ae29767d977b6a813df21c32f02;p=curl mime: be tolerant about setting twice the same header list in a part. --- diff --git a/lib/mime.c b/lib/mime.c index 496f5e6fb..7cfce6ae8 100644 --- a/lib/mime.c +++ b/lib/mime.c @@ -1356,7 +1356,8 @@ CURLcode curl_mime_headers(curl_mimepart *part, return CURLE_BAD_FUNCTION_ARGUMENT; if(part->flags & MIME_USERHEADERS_OWNER) { - curl_slist_free_all(part->userheaders); + if(part->userheaders != headers) /* Allow setting twice the same list. */ + curl_slist_free_all(part->userheaders); part->flags &= ~MIME_USERHEADERS_OWNER; } part->userheaders = headers;