The branch master has been updated
       via  a080c3e816e923680e57e647b5cbc3896e8e8106 (commit)
      from  302d1697fe09a9f4e89980f4ea84f86e63fc5e8d (commit)


- Log -----------------------------------------------------------------
commit a080c3e816e923680e57e647b5cbc3896e8e8106
Author: Bernd Edlinger <bernd.edlin...@hotmail.de>
Date:   Fri Mar 16 21:12:22 2018 +0100

    Fix a memory leak in tls1_mac
    
    Reviewed-by: Tim Hudson <t...@openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/5650)

-----------------------------------------------------------------------

Summary of changes:
 ssl/record/ssl3_record.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ssl/record/ssl3_record.c b/ssl/record/ssl3_record.c
index 4ffc842..fa902f3 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;
     }
 
_____
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits

Reply via email to