Fix memory leak with client auth.
authorDr. Stephen Henson <steve@openssl.org>
Thu, 27 Mar 2014 16:10:50 +0000 (16:10 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 27 Mar 2014 16:12:59 +0000 (16:12 +0000)
(cherry picked from commit bc5ec653ba65fedb1619c8182088497de8a97a70)

ssl/t1_lib.c

index 6c988d18297fa834be08633365a958c749592f53..31fc70e05e2d332c48f635d52a64d0fe0258cf0c 100644 (file)
@@ -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;