Curl_hsts_loadcb: don't attempt to load if hsts wasn't inited

Reported-by: Jonathan Cardoso
Fixes #7710
Closes #7711
This commit is contained in:
Daniel Stenberg 2021-09-12 23:22:47 +02:00
parent 24a7cbe9d2
commit 8822ecf7a1
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -526,7 +526,9 @@ CURLcode Curl_hsts_loadfile(struct Curl_easy *data,
*/
CURLcode Curl_hsts_loadcb(struct Curl_easy *data, struct hsts *h)
{
return hsts_pull(data, h);
if(h)
return hsts_pull(data, h);
return CURLE_OK;
}
#endif /* CURL_DISABLE_HTTP || CURL_DISABLE_HSTS */