From: Daniel Stenberg Date: Thu, 15 Jan 2026 22:08:50 +0000 (+0100) Subject: easy: fix build with --disable-form-api and --disable-mime X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65714f8130f65fb36e94d60686281d63165f858d;p=thirdparty%2Fcurl.git easy: fix build with --disable-form-api and --disable-mime Follow-up to 44312b4b11094e0 Closes #20332 --- diff --git a/lib/easy.c b/lib/easy.c index 1bab19f915..4fa979c7d1 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -891,8 +891,9 @@ static CURLcode dupset(struct Curl_easy *dst, struct Curl_easy *src) /* Copy src->set into dst->set first, then deal with the strings afterwards */ dst->set = src->set; +#if !defined(CURL_DISABLE_MIME) || !defined(CURL_DISABLE_FORM_API) dst->set.mimepostp = NULL; - +#endif /* clear all dest string and blob pointers first, in case we error out mid-function */ memset(dst->set.str, 0, STRING_LAST * sizeof(char *)); @@ -927,6 +928,7 @@ static CURLcode dupset(struct Curl_easy *dst, struct Curl_easy *src) dst->set.postfields = dst->set.str[i]; } +#if !defined(CURL_DISABLE_MIME) || !defined(CURL_DISABLE_FORM_API) if(src->set.mimepostp) { /* Duplicate mime data. Get a mimepost struct for the clone as well */ dst->set.mimepostp = curlx_malloc(sizeof(*dst->set.mimepostp)); @@ -938,6 +940,7 @@ static CURLcode dupset(struct Curl_easy *dst, struct Curl_easy *src) if(result) return result; } +#endif if(src->set.resolve) dst->state.resolve = dst->set.resolve; diff --git a/lib/url.c b/lib/url.c index c7e77b0b42..249322eace 100644 --- a/lib/url.c +++ b/lib/url.c @@ -175,8 +175,10 @@ void Curl_freeset(struct Curl_easy *data) Curl_bufref_free(&data->state.referer); Curl_bufref_free(&data->state.url); +#if !defined(CURL_DISABLE_MIME) || !defined(CURL_DISABLE_FORM_API) Curl_mime_cleanpart(data->set.mimepostp); Curl_safefree(data->set.mimepostp); +#endif #ifndef CURL_DISABLE_COOKIES curl_slist_free_all(data->state.cookielist);