summaryrefslogtreecommitdiffstats
path: root/ssl
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:53:06 +0100
commit59899c4d1b4b6ee4066a540bad2b62cb22ac3d91 (patch)
tree4ca0b7477b7bcc49b46cee99ca8d8bdb073767d3 /ssl
parenteec4cc8878752bbc74167889e601aded9a44101f (diff)
Fix memory leak.
PR#2531.
Diffstat (limited to 'ssl')
-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 b693ddab72..98e081f097 100644
--- a/ssl/t1_lib.c
+++ b/ssl/t1_lib.c
@@ -1846,7 +1846,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;