Commit 4a1fda35 authored by Daniel Lenski's avatar Daniel Lenski

Merge branch 'assign_privkey-bug' into 'master'

Small memory leak in gnutls.c:assign_privkey

See merge request openconnect/openconnect!160
parents 4df34b87 3c9479ae
......@@ -584,7 +584,8 @@ static int assign_privkey(struct openconnect_info *vpninfo,
uint8_t *free_certs)
{
gnutls_pcert_st *pcerts = gnutls_calloc(nr_certs, sizeof(*pcerts));
int i, err;
unsigned int i;
int err;
if (!pcerts)
return GNUTLS_E_MEMORY_ERROR;
......@@ -608,8 +609,8 @@ static int assign_privkey(struct openconnect_info *vpninfo,
free_pcerts:
for (i = 0 ; i < nr_certs; i++)
gnutls_pcert_deinit(pcerts + i);
free(pcerts);
}
free(pcerts);
return err;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment