[openssl-commits] [openssl] master update

bernd.edlinger at hotmail.de bernd.edlinger at hotmail.de
Sat Mar 17 07:25:56 UTC 2018


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


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

    Fix a memory leak in tls1_mac
    
    Reviewed-by: Tim Hudson <tjh at 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;
     }
 


More information about the openssl-commits mailing list