Fix leak in HMAC error path
In the event of an error in the HMAC function, leaks can occur because the HMAC_CTX does not get cleaned up. Thanks to the BoringSSL project for reporting this issue. Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
parent
68886be7e2
commit
e43a13c807
@ -219,6 +219,7 @@ unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
|
||||
HMAC_CTX_cleanup(&c);
|
||||
return md;
|
||||
err:
|
||||
HMAC_CTX_cleanup(&c);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user