Fix memory leak.
authorDr. Stephen Henson <steve@openssl.org>
Sun, 29 Jun 2014 12:51:30 +0000 (13:51 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Sun, 29 Jun 2014 12:51:57 +0000 (13:51 +0100)
PR#2531
(cherry picked from commit 44724beeadf95712a42a8b21dc71bf110e89a262)

ssl/t1_lib.c

index eefe93ed13281aaf9505aa6e7726ddc73a6f9a5d..ce144c2d73c8c51f6fcec9391fda8c189cd80775 100644 (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;