mirror of
https://github.com/curl/curl.git
synced 2026-05-17 01:46:20 +03:00
setopt: more careful cleanup of the HSTS cache
Reported-by: Joshua Rogers Closes #21615
This commit is contained in:
parent
978ea5afec
commit
d6571f7a70
1 changed files with 9 additions and 1 deletions
10
lib/setopt.c
10
lib/setopt.c
|
|
@ -1280,8 +1280,16 @@ static CURLcode setopt_long_misc(struct Curl_easy *data, CURLoption option,
|
|||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if(!data->share || !data->share->hsts) {
|
||||
/* throw away the HSTS cache unless shared */
|
||||
Curl_hsts_cleanup(&data->hsts);
|
||||
/* flush all the entries */
|
||||
curl_slist_free_all(data->state.hstslist);
|
||||
data->state.hstslist = NULL;
|
||||
}
|
||||
else
|
||||
/* detach from shared HSTS cache without freeing it */
|
||||
data->hsts = NULL;
|
||||
break;
|
||||
#endif
|
||||
#ifndef CURL_DISABLE_ALTSVC
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue