From db4f9521b536d0f8d208610465fe9e1388e01beb Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Fri, 20 Jun 2014 12:00:00 -0700 Subject: [PATCH] Fix memory leak with client auth. (Imported from upstream's bc5ec653ba65fedb1619c8182088497de8a97a70) --- ssl/t1_lib.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 8964352e..1eac1695 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -3987,6 +3987,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) { @@ -4043,6 +4048,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;