提交 4563da1d 编写于 作者: D Dr. Stephen Henson

Fix memory leak with client auth.

(cherry picked from commit bc5ec653ba65fedb1619c8182088497de8a97a70)
上级 f0ef019d
...@@ -3644,6 +3644,11 @@ static int tls1_set_shared_sigalgs(SSL *s) ...@@ -3644,6 +3644,11 @@ static int tls1_set_shared_sigalgs(SSL *s)
TLS_SIGALGS *salgs = NULL; TLS_SIGALGS *salgs = NULL;
CERT *c = s->cert; CERT *c = s->cert;
unsigned int is_suiteb = tls1_suiteb(s); 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 client use client signature algorithms if not NULL */
if (!s->server && c->client_sigalgs && !is_suiteb) if (!s->server && c->client_sigalgs && !is_suiteb)
{ {
...@@ -3700,6 +3705,8 @@ int tls1_process_sigalgs(SSL *s, const unsigned char *data, int dsize) ...@@ -3700,6 +3705,8 @@ int tls1_process_sigalgs(SSL *s, const unsigned char *data, int dsize)
if (!c) if (!c)
return 0; return 0;
if (c->peer_sigalgs)
OPENSSL_free(c->peer_sigalgs);
c->peer_sigalgs = OPENSSL_malloc(dsize); c->peer_sigalgs = OPENSSL_malloc(dsize);
if (!c->peer_sigalgs) if (!c->peer_sigalgs)
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册