summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2018-03-16 21:12:22 +0100
committerBernd Edlinger <bernd.edlinger@hotmail.de>2018-03-17 08:25:25 +0100
commita080c3e816e923680e57e647b5cbc3896e8e8106 (patch)
tree4ac69cdab1077ba46529e20e506f3a8abd93180b /ssl
parent302d1697fe09a9f4e89980f4ea84f86e63fc5e8d (diff)
Fix a memory leak in tls1_mac
Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5650)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/record/ssl3_record.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ssl/record/ssl3_record.c b/ssl/record/ssl3_record.c
index 4ffc84279d..fa902f30fb 100644
--- a/ssl/record/ssl3_record.c
+++ b/ssl/record/ssl3_record.c
@@ -1297,8 +1297,10 @@ int tls1_mac(SSL *ssl, SSL3_RECORD *rec, unsigned char *md, int sending)
mac_ctx = hash;
} else {
hmac = EVP_MD_CTX_new();
- if (hmac == NULL || !EVP_MD_CTX_copy(hmac, hash))
+ if (hmac == NULL || !EVP_MD_CTX_copy(hmac, hash)) {
+ EVP_MD_CTX_free(hmac);
return 0;
+ }
mac_ctx = hmac;
}