From 3e8f9dc1a07df10dd52544efa269628744a40173 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Mon, 8 Jun 2015 09:29:56 +0100 Subject: [PATCH] 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) --- crypto/hmac/hmac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c index 5ca389406b..15a9a21299 100644 --- a/crypto/hmac/hmac.c +++ b/crypto/hmac/hmac.c @@ -261,6 +261,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; } -- 2.34.1