summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2014-05-26 20:11:28 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2014-05-26 20:11:28 +0000
commitd0ab989fb57b235368e65cbea1594c1d40d70049 (patch)
tree5f4d057d32bb5219e01c2f283fcc8bd4965bd24e /lib
parent37f26e6490c0a962b42773002a3ec12fb95bccb6 (diff)
tls_decrypt_ticket(): memory leak and uncleaned EVP_CIPHER_CTX upon error.
Diffstat (limited to 'lib')
-rw-r--r--lib/libssl/src/ssl/t1_lib.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libssl/src/ssl/t1_lib.c b/lib/libssl/src/ssl/t1_lib.c
index 0ea9ce752d2..99298c1791c 100644
--- a/lib/libssl/src/ssl/t1_lib.c
+++ b/lib/libssl/src/ssl/t1_lib.c
@@ -2133,8 +2133,11 @@ tls_decrypt_ticket(SSL *s, const unsigned char *etick, int eticklen,
return -1;
}
EVP_DecryptUpdate(&ctx, sdec, &slen, p, eticklen);
- if (EVP_DecryptFinal(&ctx, sdec + slen, &mlen) <= 0)
+ if (EVP_DecryptFinal(&ctx, sdec + slen, &mlen) <= 0) {
+ free(sdec);
+ EVP_CIPHER_CTX_cleanup(&ctx);
return 2;
+ }
slen += mlen;
EVP_CIPHER_CTX_cleanup(&ctx);
p = sdec;