openssl: Fix memory leak if HMAC instantiation fails late
Fixes: db0c53c207 ("openssl: Fixes for HMAC with OpenSSL 3.0")
This commit is contained in:
@@ -229,6 +229,7 @@ static mac_t *hmac_create(hash_algorithm_t algo)
|
|||||||
EVP_MAC_free(mac);
|
EVP_MAC_free(mac);
|
||||||
if (!this->hmac_base || !EVP_MAC_CTX_set_params(this->hmac_base, params))
|
if (!this->hmac_base || !EVP_MAC_CTX_set_params(this->hmac_base, params))
|
||||||
{
|
{
|
||||||
|
EVP_MAC_CTX_free(this->hmac_base);
|
||||||
free(this);
|
free(this);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user