summaryrefslogtreecommitdiffstats
path: root/ssl/t1_lib.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2014-06-29 13:53:06 +0100
committerDr. Stephen Henson <steve@openssl.org>2014-06-29 13:54:21 +0100
commit9e6857a358282727a4ceea31e1db3dbc8e394bf8 (patch)
treeff702f094220e85d6436267aa5d1a28b70c7a45a /ssl/t1_lib.c
parent715258486ccf02f47b98323fca0524d674b37323 (diff)
Fix memory leak.
PR#2531. (cherry picked from commit 59899c4d1b4b6ee4066a540bad2b62cb22ac3d91)
Diffstat (limited to 'ssl/t1_lib.c')
-rw-r--r--ssl/t1_lib.c4
1 files changed, 4 insertions, 0 deletions
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;