From: Dr. Stephen Henson Date: Sun, 29 Jun 2014 12:53:06 +0000 (+0100) Subject: Fix memory leak. X-Git-Tag: OpenSSL_0_9_8zb~43 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9e6857a358282727a4ceea31e1db3dbc8e394bf8;p=oweals%2Fopenssl.git Fix memory leak. PR#2531. (cherry picked from commit 59899c4d1b4b6ee4066a540bad2b62cb22ac3d91) --- diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 09b06a5af7..8638eb9a41 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -1114,7 +1114,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); goto tickerr; + } slen += mlen; EVP_CIPHER_CTX_cleanup(&ctx); p = sdec;