summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2018-03-16 21:36:48 +0100
committerBernd Edlinger <bernd.edlinger@hotmail.de>2018-03-17 08:29:45 +0100
commitec76f1794a55276c719617b23e816850646c43ff (patch)
treea876c4c0a3351d6bdf532012a2355d14fccd112b
parentba2502d7a63514cdc6a517bb0b095867c3cf13f3 (diff)
Fix a memory leak in tls1_mac
Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5651)
-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 f6e59d2f84..6e1ff3f563 100644
--- a/ssl/record/ssl3_record.c
+++ b/ssl/record/ssl3_record.c
@@ -988,8 +988,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 -1;
+ }
mac_ctx = hmac;
}