mirror of
https://github.com/curl/curl.git
synced 2026-01-18 17:21:26 +01:00
easy: fix build with --disable-form-api and --disable-mime
Follow-up to 44312b4b11
Closes #20332
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user