From: Matt Caswell Date: Mon, 8 Jun 2015 08:29:56 +0000 (+0100) Subject: Fix leak in HMAC error path X-Git-Tag: OpenSSL_1_0_1n~11 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=418df5ea232811dc7339380c1aa5e07c28c6c6dc;p=oweals%2Fopenssl.git 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 (cherry picked from commit e43a13c807e42688c72c4f3d001112bf0a110464) --- diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c index b1f7317d7b..5925467818 100644 --- a/crypto/hmac/hmac.c +++ b/crypto/hmac/hmac.c @@ -251,6 +251,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; }