http: return OOM errors from hsts properly

When Curl_hsts_parse() fails with out of memory, return it to parent.

Closes #19862
This commit is contained in:
Daniel Stenberg 2025-12-07 12:35:42 +01:00
parent 9ec63d8565
commit a3f4fd25d3
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -3501,8 +3501,11 @@ static CURLcode http_header_s(struct Curl_easy *data,
if(v) {
CURLcode check =
Curl_hsts_parse(data->hsts, conn->host.name, v);
if(check)
if(check) {
if(check == CURLE_OUT_OF_MEMORY)
return check;
infof(data, "Illegal STS header skipped");
}
#ifdef DEBUGBUILD
else
infof(data, "Parsed STS header fine (%zu entries)",