Navigation Menu

Skip to content

Commit

Permalink
OpenSSL: Fix leak of cert_x509
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jun 12, 2012
1 parent 06137d4 commit 97e7760
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions openssl.c
Expand Up @@ -1312,9 +1312,15 @@ void openconnect_close_https(struct openconnect_info *vpninfo, int final)
FD_CLR(vpninfo->ssl_fd, &vpninfo->select_efds);
vpninfo->ssl_fd = -1;
}
if (final && vpninfo->https_ctx) {
SSL_CTX_free(vpninfo->https_ctx);
vpninfo->https_ctx = NULL;
if (final) {
if (vpninfo->https_ctx) {
SSL_CTX_free(vpninfo->https_ctx);
vpninfo->https_ctx = NULL;
}
if (vpninfo->cert_x509) {
X509_free(vpninfo->cert_x509);
vpninfo->cert_x509 = NULL;
}
}
}

Expand Down

0 comments on commit 97e7760

Please sign in to comment.