summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/mime.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-09-20 17:09:59 (GMT)
committerBrad King <brad.king@kitware.com>2023-09-22 14:55:37 (GMT)
commitc1f76e6c211e9e562328f1c0571e8877599f880e (patch)
treef4c879a444b512b178f89ccd5b1c0f4a0db4ee99 /Utilities/cmcurl/lib/mime.c
parent1fb19cbdad18011756945f84d19951a199a399bc (diff)
parent017637e40f954e791a895a04855d0411bda61c10 (diff)
downloadCMake-c1f76e6c211e9e562328f1c0571e8877599f880e.zip
CMake-c1f76e6c211e9e562328f1c0571e8877599f880e.tar.gz
CMake-c1f76e6c211e9e562328f1c0571e8877599f880e.tar.bz2
Merge branch 'upstream-curl' into update-curl
* upstream-curl: curl 2023-09-13 (6fa1d817) Upstream significantly refactored `lib/CMakeLists.txt`, so take the upstream version of everything except the code added by commit 54cb23c657 (curl: Restore installation of OpenSSL DLLs, 2014-11-03, v3.2.0-rc1~418^2~4). We will apply our customizations again in a follow-up commit.
Diffstat (limited to 'Utilities/cmcurl/lib/mime.c')
-rw-r--r--Utilities/cmcurl/lib/mime.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/Utilities/cmcurl/lib/mime.c b/Utilities/cmcurl/lib/mime.c
index 0a57e1e..842b2da 100644
--- a/Utilities/cmcurl/lib/mime.c
+++ b/Utilities/cmcurl/lib/mime.c
@@ -1167,14 +1167,16 @@ static void mime_subparts_unbind(void *ptr)
void Curl_mime_cleanpart(curl_mimepart *part)
{
- cleanup_part_content(part);
- curl_slist_free_all(part->curlheaders);
- if(part->flags & MIME_USERHEADERS_OWNER)
- curl_slist_free_all(part->userheaders);
- Curl_safefree(part->mimetype);
- Curl_safefree(part->name);
- Curl_safefree(part->filename);
- Curl_mime_initpart(part);
+ if(part) {
+ cleanup_part_content(part);
+ curl_slist_free_all(part->curlheaders);
+ if(part->flags & MIME_USERHEADERS_OWNER)
+ curl_slist_free_all(part->userheaders);
+ Curl_safefree(part->mimetype);
+ Curl_safefree(part->name);
+ Curl_safefree(part->filename);
+ Curl_mime_initpart(part);
+ }
}
/* Recursively delete a mime handle and its parts. */