]> granicus.if.org Git - curl/commitdiff
mime: properly unbind mime structure in curl_mime_free().
authorPatrick Monnerat <patrick@monnerat.net>
Mon, 9 Oct 2017 00:26:27 +0000 (01:26 +0100)
committerPatrick Monnerat <patrick@monnerat.net>
Mon, 9 Oct 2017 00:26:27 +0000 (01:26 +0100)
This allows freeing a mime structure bound to the easy handle before
curl_easy_cleanup().

Fixes #1970.

lib/mime.c

index 04746ed09d150121ad91768041aa4e77ae507e29..cba95b929845f5fc64323119182a97091e199a8a 100644 (file)
@@ -1130,6 +1130,7 @@ void curl_mime_free(curl_mime *mime)
   curl_mimepart *part;
 
   if(mime) {
+    mime_subparts_unbind(mime);  /* Be sure it's not referenced anymore. */
     while(mime->firstpart) {
       part = mime->firstpart;
       mime->firstpart = part->nextpart;