}
/* deallocate the SSL connection */
+ if (sslconn->client_cert) {
+ X509_free(sslconn->client_cert);
+ sslconn->client_cert = NULL;
+ }
SSL_free(ssl);
sslconn->ssl = NULL;
filter_ctx->pssl = NULL; /* so filters know we've been shutdown */
* Remember the peer certificate's DN
*/
if ((cert = SSL_get_peer_certificate(filter_ctx->pssl))) {
+ if (sslconn->client_cert) {
+ X509_free(sslconn->client_cert);
+ }
sslconn->client_cert = cert;
sslconn->client_dn = NULL;
- X509_free(cert);
}
/*
* Remember the peer certificate's DN
*/
if ((cert = SSL_get_peer_certificate(ssl))) {
+ if (sslconn->client_cert) {
+ X509_free(sslconn->client_cert);
+ }
sslconn->client_cert = cert;
sslconn->client_dn = NULL;
}
"Certificate Verification: Error (%d): %s",
errnum, X509_verify_cert_error_string(errnum));
+ if (sslconn->client_cert) {
+ X509_free(sslconn->client_cert);
+ sslconn->client_cert = NULL;
+ }
sslconn->client_dn = NULL;
- sslconn->client_cert = NULL;
sslconn->verify_error = X509_verify_cert_error_string(errnum);
}