Fix memory leak.

PR#2531
(cherry picked from commit 44724beead)
This commit is contained in:
Dr. Stephen Henson 2014-06-29 13:51:30 +01:00
parent 4824e7d6e9
commit 15de0f609c

View file

@ -3381,7 +3381,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;