From 0c214e01535fb5e4d14f5fd24bd91b948f6c0535 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Wed, 4 Jan 2012 14:25:10 +0000 Subject: [PATCH] Submitted by: Adam Langley Reviewed by: steve Fix memory leaks. --- ssl/s3_srvr.c | 1 + ssl/t1_lib.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c index 89822de8f0..4850a9a957 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -1952,6 +1952,7 @@ int ssl3_get_client_key_exchange(SSL *s) if (i <= 0) { SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,ERR_R_DH_LIB); + BN_clear_free(pub); goto err; } diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 92cac13002..cc97258ae5 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -575,6 +575,12 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in sdata = data; if (dsize > 0) { + if (s->tlsext_ocsp_exts) + { + sk_X509_EXTENSION_pop_free(s->tlsext_ocsp_exts, + X509_EXTENSION_free); + } + s->tlsext_ocsp_exts = d2i_X509_EXTENSIONS(NULL, &sdata, dsize); -- 2.25.1