summaryrefslogtreecommitdiffstats
path: root/crypto/hmac/hmac.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-06-08 10:29:56 +0200
committerMatt Caswell <matt@openssl.org>2015-06-10 12:03:20 +0200
commite43a13c807e42688c72c4f3d001112bf0a110464 (patch)
treeb81219fb8cf576bfcc326f3793660647eaf512c7 /crypto/hmac/hmac.c
parentEC_POINT_is_on_curve does not return a boolean (diff)
downloadopenssl-e43a13c807e42688c72c4f3d001112bf0a110464.tar.xz
openssl-e43a13c807e42688c72c4f3d001112bf0a110464.zip
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>
Diffstat (limited to 'crypto/hmac/hmac.c')
-rw-r--r--crypto/hmac/hmac.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c
index 572393e2c7..d50fabb7c1 100644
--- a/crypto/hmac/hmac.c
+++ b/crypto/hmac/hmac.c
@@ -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;
}