]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
easy: in duphandle, init the cookies for the new handle
authorDaniel Stenberg <daniel@haxx.se>
Mon, 13 Nov 2023 18:55:28 +0000 (19:55 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 13 Nov 2023 22:00:53 +0000 (23:00 +0100)
... not the source handle.

Closes #12318

lib/easy.c

index 3341f466149547be74229bff84d405544b21b9af..f97003fc664ada3200d767ded9285ea7fe03df66 100644 (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;