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);
|
HMAC_CTX_cleanup(&c);
|
||||||
return md;
|
return md;
|
||||||
err:
|
err:
|
||||||
|
HMAC_CTX_cleanup(&c);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user