From 3c56d65a417115625d4f966d99fda1dcc74910a6 Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Mon, 11 Jun 2012 09:23:38 +0000 Subject: [PATCH] Fix memory leak. --- ssl/s3_lib.c | 7 +++++++ ssl/t1_lib.c | 2 ++ 2 files changed, 9 insertions(+) diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 9c1ffd4187..d520a11939 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -3036,6 +3036,13 @@ void ssl3_clear(SSL *s) s->s3->tmp.ecdh = NULL; } #endif +#ifndef OPENSSL_NO_TLSEXT + if (s->s3->tlsext_authz_client_types != NULL) + { + OPENSSL_free(s->s3->tlsext_authz_client_types); + s->s3->tlsext_authz_client_types = NULL; + } +#endif rp = s->s3->rbuf.buf; wp = s->s3->wbuf.buf; diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 85a5681f87..5b285995ab 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -1781,6 +1781,8 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char if (!s->hit) { size_t i; + if (s->s3->tlsext_authz_client_types != NULL) + OPENSSL_free(s->s3->tlsext_authz_client_types); s->s3->tlsext_authz_client_types = OPENSSL_malloc(server_authz_dataformatlist_length); if (!s->s3->tlsext_authz_client_types) -- 2.25.1