openssl: Fix memory leak if HMAC instantiation fails late

Fixes: db0c53c207 ("openssl: Fixes for HMAC with OpenSSL 3.0")
This commit is contained in:
Tobias Brunner
2026-07-23 10:26:08 +02:00
parent 3a30390d91
commit 355d591967
@@ -229,6 +229,7 @@ static mac_t *hmac_create(hash_algorithm_t algo)
EVP_MAC_free(mac);
if (!this->hmac_base || !EVP_MAC_CTX_set_params(this->hmac_base, params))
{
EVP_MAC_CTX_free(this->hmac_base);
free(this);
return NULL;
}