From 4563da1d7c53e969e8d092d018795179bb648a7c Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Thu, 27 Mar 2014 16:10:50 +0000 Subject: [PATCH] Fix memory leak with client auth. (cherry picked from commit bc5ec653ba65fedb1619c8182088497de8a97a70) --- ssl/t1_lib.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 6c988d1829..31fc70e05e 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -3644,6 +3644,11 @@ static int tls1_set_shared_sigalgs(SSL *s) TLS_SIGALGS *salgs = NULL; CERT *c = s->cert; unsigned int is_suiteb = tls1_suiteb(s); + if (c->shared_sigalgs) + { + OPENSSL_free(c->shared_sigalgs); + c->shared_sigalgs = NULL; + } /* If client use client signature algorithms if not NULL */ if (!s->server && c->client_sigalgs && !is_suiteb) { @@ -3700,6 +3705,8 @@ int tls1_process_sigalgs(SSL *s, const unsigned char *data, int dsize) if (!c) return 0; + if (c->peer_sigalgs) + OPENSSL_free(c->peer_sigalgs); c->peer_sigalgs = OPENSSL_malloc(dsize); if (!c->peer_sigalgs) return 0; -- GitLab