Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
OpenSSL: Fix password memory leaks
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jun 12, 2012
1 parent 97d68d9 commit 443e7e5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openssl.c
Expand Up @@ -447,8 +447,10 @@ static int load_pkcs12_certificate(struct openconnect_info *vpninfo, PKCS12 *p12
vpn_progress(vpninfo, PRG_ERR,
_("Parse PKCS#12 failed (see above errors)\n"));
PKCS12_free(p12);
free(pass);
return -EINVAL;
}
free(pass);
if (cert) {
char buf[200];
vpninfo->cert_x509 = cert;
Expand Down Expand Up @@ -531,6 +533,8 @@ static int load_tpm_certificate(struct openconnect_info *vpninfo)
_("Failed to set TPM SRK password\n"));
openconnect_report_ssl_errors(vpninfo);
}
vpninfo->cert_password = NULL;
free(vpninfo->cert_password);
} else {
/* Provide our own UI method to handle the PIN callback. */
meth = create_openssl_ui(vpninfo);
Expand Down

0 comments on commit 443e7e5

Please sign in to comment.