Added ldap_pvt_tls_destroy() to cleanup TLS library on shutdown

This commit is contained in:
Howard Chu 2001-11-06 20:52:59 +00:00
parent 67886fc4a1
commit 33ace5610c
3 changed files with 16 additions and 0 deletions

View file

@ -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 ));

View file

@ -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.
*/

View file

@ -542,6 +542,10 @@ stop:
#endif
slapd_daemon_destroy();
#ifdef HAVE_TLS
ldap_pvt_tls_destroy();
#endif
#ifdef CSRIMALLOC
mal_dumpleaktrace( leakfile );
#endif