Fix a memory leak in n_ssl3_mac
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 16 Mar 2018 15:45:55 +0000 (16:45 +0100)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Sat, 17 Mar 2018 07:23:43 +0000 (08:23 +0100)
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5648)

ssl/record/ssl3_record.c

index 5bfbaf9..4ffc842 100644 (file)
@@ -1256,7 +1256,7 @@ int n_ssl3_mac(SSL *ssl, SSL3_RECORD *rec, unsigned char *md, int sending)
             || EVP_DigestUpdate(md_ctx, ssl3_pad_2, npad) <= 0
             || EVP_DigestUpdate(md_ctx, md, md_size) <= 0
             || EVP_DigestFinal_ex(md_ctx, md, &md_size_u) <= 0) {
-            EVP_MD_CTX_reset(md_ctx);
+            EVP_MD_CTX_free(md_ctx);
             return 0;
         }