Commit 97e77603 authored by David Woodhouse's avatar David Woodhouse

OpenSSL: Fix leak of cert_x509

Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 06137d45
......@@ -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;
}
}
}
......
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