]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
easy: fix build with --disable-form-api and --disable-mime
authorDaniel Stenberg <daniel@haxx.se>
Thu, 15 Jan 2026 22:08:50 +0000 (23:08 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 15 Jan 2026 22:32:52 +0000 (23:32 +0100)
Follow-up to 44312b4b11094e0

Closes #20332

lib/easy.c
lib/url.c

index 1bab19f91598cd9643fa0e789125102df660dc57..4fa979c7d11af06198a01af1b0216c0ea2369202 100644 (file)
@@ -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;
index c7e77b0b42ea0ef5e9dd4cc10d4f795ca410cf63..249322eaceb5a5411392624cdcc93cd14874fb23 100644 (file)
--- 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);