← Commit list

d6571f7a70

Daniel Stenberg
Daniel Stenberg
2026-05-16
SUCCESS Duration: 225s

Subject

setopt: more careful cleanup of the HSTS cache

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/setopt.c+9 -1
@@ -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