Fix memory leak.
authorDr. Stephen Henson <steve@openssl.org>
Sun, 29 Jun 2014 12:53:06 +0000 (13:53 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Sun, 29 Jun 2014 12:54:21 +0000 (13:54 +0100)
PR#2531.
(cherry picked from commit 59899c4d1b4b6ee4066a540bad2b62cb22ac3d91)

ssl/t1_lib.c

index 09b06a5af7306cbde3cb2fbb954f69fba9e010c8..8638eb9a41ec36fbb8aa8d431e31f52154686ef7 100644 (file)
@@ -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;