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:10:50 +0000 (16:10 +0000)
ssl/t1_lib.c

index db9a14870c4a93498ce31f4129e413f0264ad633..ed3d07a0e016349848e1161a5cab3ad4a23ca23c 100644 (file)
@@ -3606,6 +3606,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)
                {
@@ -3662,6 +3667,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;