From: Bernd Edlinger Date: Fri, 16 Mar 2018 16:07:54 +0000 (+0100) Subject: Fix a memory leak in n_ssl3_mac X-Git-Tag: OpenSSL_1_1_0h~28 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ba2502d7a63514cdc6a517bb0b095867c3cf13f3;p=oweals%2Fopenssl.git Fix a memory leak in n_ssl3_mac Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/5649) --- diff --git a/ssl/record/ssl3_record.c b/ssl/record/ssl3_record.c index 6c74ea5689..f6e59d2f84 100644 --- a/ssl/record/ssl3_record.c +++ b/ssl/record/ssl3_record.c @@ -947,7 +947,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 -1; } md_size = md_size_u;