From 44724beeadf95712a42a8b21dc71bf110e89a262 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Sun, 29 Jun 2014 13:51:30 +0100 Subject: [PATCH] Fix memory leak. PR#2531 --- ssl/t1_lib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index cf007f9cce..657ab1d1dd 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -3455,7 +3455,11 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, int eticklen, } EVP_DecryptUpdate(&ctx, sdec, &slen, p, eticklen); if (EVP_DecryptFinal(&ctx, sdec + slen, &mlen) <= 0) + { + EVP_CIPHER_CTX_cleanup(&ctx); + OPENSSL_free(sdec); return 2; + } slen += mlen; EVP_CIPHER_CTX_cleanup(&ctx); p = sdec; -- 2.25.1