easy: in duphandle, init the cookies for the new handle

... not the source handle.

Closes #12318
This commit is contained in:
Daniel Stenberg 2023-11-13 19:55:28 +01:00
parent baf7b803b3
commit 34eddaac92
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -914,10 +914,10 @@ struct Curl_easy *curl_easy_duphandle(struct Curl_easy *data)
outcurl->progress.callback = data->progress.callback;
#ifndef CURL_DISABLE_COOKIES
if(data->cookies) {
if(data->cookies && data->state.cookie_engine) {
/* If cookies are enabled in the parent handle, we enable them
in the clone as well! */
outcurl->cookies = Curl_cookie_init(data, NULL, outcurl->cookies,
outcurl->cookies = Curl_cookie_init(outcurl, NULL, outcurl->cookies,
data->set.cookiesession);
if(!outcurl->cookies)
goto fail;