Skip to content
Snippets Groups Projects
Commit 33ace561 authored by Howard Chu's avatar Howard Chu
Browse files

Added ldap_pvt_tls_destroy() to cleanup TLS library on shutdown

parent 67886fc4
No related branches found
No related tags found
No related merge requests found
......@@ -173,6 +173,7 @@ LDAP_F (int) ldap_pvt_tls_get_option LDAP_P(( struct ldap *ld,
LDAP_F (int) ldap_pvt_tls_set_option LDAP_P(( struct ldap *ld,
int option, void *arg ));
LDAP_F (void) ldap_pvt_tls_destroy LDAP_P(( void ));
LDAP_F (int) ldap_pvt_tls_init LDAP_P(( void ));
LDAP_F (int) ldap_pvt_tls_accept LDAP_P(( Sockbuf *sb, void *ctx_arg ));
LDAP_F (int) ldap_pvt_tls_inplace LDAP_P(( Sockbuf *sb ));
......
......@@ -97,6 +97,17 @@ static void tls_init_threads( void )
}
#endif /* LDAP_R_COMPILE */
/*
* Tear down the TLS subsystem. Should only be called once.
*/
void
ldap_pvt_tls_destroy( void )
{
SSL_CTX_free(tls_def_ctx);
EVP_cleanup();
ERR_free_strings();
}
/*
* Initialize TLS subsystem. Should be called only once.
*/
......
......@@ -542,6 +542,10 @@ stop:
#endif
slapd_daemon_destroy();
#ifdef HAVE_TLS
ldap_pvt_tls_destroy();
#endif
#ifdef CSRIMALLOC
mal_dumpleaktrace( leakfile );
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment