From: Daniel Stenberg Date: Sun, 5 Mar 2023 23:18:41 +0000 (+0100) Subject: cookie: don't load cookies again when flushing X-Git-Tag: curl-8_0_0~94 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=45d4bf5af38df12e194427a4e1ac8f3da75b33e3;p=thirdparty%2Fcurl.git cookie: don't load cookies again when flushing Reported-by: Sergio Mijatovic Fixes #10677 Closes #10685 --- diff --git a/lib/cookie.c b/lib/cookie.c index fb8b4e97fb..0c6e0f7cda 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -336,10 +336,9 @@ void Curl_cookie_loadfiles(struct Curl_easy *data) if(list) { Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); while(list) { - struct CookieInfo *newcookies = Curl_cookie_init(data, - list->data, - data->cookies, - data->set.cookiesession); + struct CookieInfo *newcookies = + Curl_cookie_init(data, list->data, data->cookies, + data->set.cookiesession); if(!newcookies) /* * Failure may be due to OOM or a bad cookie; both are ignored @@ -1800,11 +1799,6 @@ void Curl_flush_cookies(struct Curl_easy *data, bool cleanup) CURLcode res; if(data->set.str[STRING_COOKIEJAR]) { - /* If there is a list of cookie files to read, do it first so that - we have all the told files read before we write the new jar. - Curl_cookie_loadfiles() LOCKS and UNLOCKS the share itself! */ - Curl_cookie_loadfiles(data); - Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); /* if we have a destination file for all the cookies to get dumped to */