From: Daniel Stenberg Date: Thu, 2 Jun 2022 13:45:27 +0000 (+0200) Subject: easy/transfer: fix cookie-disabled build X-Git-Tag: curl-7_84_0~89 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2bd75e5686b2e6ff3824c4dfb2b6ec86b60f454c;p=thirdparty%2Fcurl.git easy/transfer: fix cookie-disabled build Follow-up from 45de940cebf6a Reported-by: Marcel Raad Fixes #8953 Closes #8954 --- diff --git a/lib/easy.c b/lib/easy.c index bd9d695bb5..336cada878 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -838,6 +838,7 @@ struct Curl_easy *curl_easy_duphandle(struct Curl_easy *data) outcurl->progress.flags = data->progress.flags; outcurl->progress.callback = data->progress.callback; +#ifndef CURL_DISABLE_COOKIES if(data->cookies) { /* If cookies are enabled in the parent handle, we enable them in the clone as well! */ @@ -856,6 +857,7 @@ struct Curl_easy *curl_easy_duphandle(struct Curl_easy *data) if(!outcurl->state.cookielist) goto fail; } +#endif if(data->state.url) { outcurl->state.url = strdup(data->state.url); @@ -937,8 +939,10 @@ struct Curl_easy *curl_easy_duphandle(struct Curl_easy *data) fail: if(outcurl) { +#ifndef CURL_DISABLE_COOKIES curl_slist_free_all(outcurl->state.cookielist); outcurl->state.cookielist = NULL; +#endif Curl_safefree(outcurl->state.buffer); Curl_dyn_free(&outcurl->state.headerb); Curl_safefree(outcurl->state.url); diff --git a/lib/transfer.c b/lib/transfer.c index 27eec8a46b..01f764ac50 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -1422,10 +1422,11 @@ CURLcode Curl_pretransfer(struct Curl_easy *data) else data->state.infilesize = 0; +#ifndef CURL_DISABLE_COOKIES /* If there is a list of cookie files to read, do it now! */ if(data->state.cookielist) Curl_cookie_loadfiles(data); - +#endif /* If there is a list of host pairs to deal with */ if(data->state.resolve) result = Curl_loadhostpairs(data);