diff options
author | Patrick Monnerat <patrick@monnerat.net> | 2017-10-08 16:20:13 +0100 |
---|---|---|
committer | Patrick Monnerat <patrick@monnerat.net> | 2017-10-08 16:20:13 +0100 |
commit | 93e62adde88b6ae29767d977b6a813df21c32f02 (patch) | |
tree | 1315d34384a9fe78e89cdea97564fc192b211575 /lib | |
parent | 14d6e207d35792e3e10a674b2e27cf2aa3370bf8 (diff) |
mime: be tolerant about setting twice the same header list in a part.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mime.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; |