summaryrefslogtreecommitdiff
path: root/lib/easy.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2022-12-22 13:09:16 +0100
committerDaniel Stenberg <daniel@haxx.se>2022-12-22 16:06:37 +0100
commitaf5999a6742ea90011e7fa08aade7eac9943b76a (patch)
tree4786ccad2f06062af09de06fea93199ebbf9337f /lib/easy.c
parente4505a1915f1bfae71b06636f0690fae2c53c78e (diff)
downloadcurl-af5999a6742ea90011e7fa08aade7eac9943b76a.tar.gz
urldata: move the cookefilelist to the 'set' struct
The cookiefile entries are set into the handle and should remain set for the lifetime of the handle so that duplicating it also duplicates the list. Therefore, the struct field is moved from 'state' to 'set'. Fixes #10133 Closes #10134
Diffstat (limited to 'lib/easy.c')
-rw-r--r--lib/easy.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/easy.c b/lib/easy.c
index d7da09601..2a94bc52a 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -913,11 +913,9 @@ struct Curl_easy *curl_easy_duphandle(struct Curl_easy *data)
goto fail;
}
- /* duplicate all values in 'change' */
- if(data->state.cookielist) {
- outcurl->state.cookielist =
- Curl_slist_duplicate(data->state.cookielist);
- if(!outcurl->state.cookielist)
+ if(data->set.cookielist) {
+ outcurl->set.cookielist = Curl_slist_duplicate(data->set.cookielist);
+ if(!outcurl->set.cookielist)
goto fail;
}
#endif
@@ -1003,8 +1001,8 @@ struct Curl_easy *curl_easy_duphandle(struct Curl_easy *data)
if(outcurl) {
#ifndef CURL_DISABLE_COOKIES
- curl_slist_free_all(outcurl->state.cookielist);
- outcurl->state.cookielist = NULL;
+ curl_slist_free_all(outcurl->set.cookielist);
+ outcurl->set.cookielist = NULL;
#endif
Curl_safefree(outcurl->state.buffer);
Curl_dyn_free(&outcurl->state.headerb);