}
if ( !BER_BVISNULL( &bindconf.sb_authzId ) ) {
- ber_dupbv( &lloadd_identity, &bindconf.sb_authzId );
+ ber_bvreplace( &lloadd_identity, &bindconf.sb_authzId );
} else if ( !BER_BVISNULL( &bindconf.sb_authcId ) ) {
- ber_dupbv( &lloadd_identity, &bindconf.sb_authcId );
+ ber_bvreplace( &lloadd_identity, &bindconf.sb_authcId );
} else if ( !BER_BVISNULL( &bindconf.sb_binddn ) ) {
char *ptr;
lloadd_identity.bv_len = STRLENOF("dn:") + bindconf.sb_binddn.bv_len;
- lloadd_identity.bv_val = ch_malloc( lloadd_identity.bv_len + 1 );
+ lloadd_identity.bv_val = ch_realloc(
+ lloadd_identity.bv_val, lloadd_identity.bv_len + 1 );
ptr = lutil_strcopy( lloadd_identity.bv_val, "dn:" );
ptr = lutil_strncopy(
if ( CONFIG_ONLINE_ADD( c ) ) {
assert( tier );
lload_change.target = tier;
+ ch_free( c->value_string );
return rc;
}
tier_impl = lload_tier_find( c->value_string );
+ ch_free( c->value_string );
if ( !tier_impl ) {
goto fail;
}
}
}
+ event_free( lload_stats_event );
+ event_free( lload_timeout_event );
+
event_base_free( daemon_base );
daemon_base = NULL;
return LDAP_SUCCESS;
}
+
+void
+lload_exop_destroy( void )
+{
+ ldap_avl_free( lload_exop_handlers, NULL );
+ lload_exop_handlers = NULL;
+}
return 0;
}
+int
+lload_global_destroy( void )
+{
+ if ( !BER_BVISNULL( &lloadd_identity ) ) {
+ ch_free( lloadd_identity.bv_val );
+ BER_BVZERO( &lloadd_identity );
+ }
+
+ lload_exop_destroy();
+
+#ifdef HAVE_TLS
+ if ( lload_tls_backend_ld ) {
+ ldap_unbind_ext( lload_tls_backend_ld, NULL, NULL );
+ }
+ if ( lload_tls_ld ) {
+ ldap_unbind_ext( lload_tls_ld, NULL, NULL );
+ }
+#endif
+
+ ldap_pvt_thread_mutex_destroy( &lload_wait_mutex );
+ ldap_pvt_thread_cond_destroy( &lload_wait_cond );
+ ldap_pvt_thread_cond_destroy( &lload_pause_cond );
+
+ ldap_pvt_thread_mutex_destroy( &clients_mutex );
+ ldap_pvt_thread_mutex_destroy( &lload_pin_mutex );
+
+ lload_libevent_destroy();
+
+ return 0;
+}
+
int
lload_tls_init( void )
{
(void)loglevel_print( stdout );
}
/* remember an error during destroy */
+ rc |= lload_global_destroy();
rc |= lload_destroy();
stop:
return 0;
}
+int
+lload_back_destroy( BackendInfo *bi )
+{
+ return lload_global_destroy();
+}
+
int
lload_back_initialize( BackendInfo *bi )
{
bi->bi_pause = lload_pause_cb;
bi->bi_unpause = lload_unpause_cb;
bi->bi_close = lload_back_close;
- bi->bi_destroy = 0;
+ bi->bi_destroy = lload_back_destroy;
bi->bi_db_init = 0;
bi->bi_db_config = 0;
LDAP_SLAPD_F (int) exop_handler_cmp( const void *l, const void *r );
LDAP_SLAPD_F (int) request_extended( LloadConnection *c, LloadOperation *op );
LDAP_SLAPD_F (int) lload_exop_init( void );
+LDAP_SLAPD_F (void) lload_exop_destroy( void );
/*
* init.c
*/
LDAP_SLAPD_F (int) lload_global_init( void );
+LDAP_SLAPD_F (int) lload_global_destroy( void );
LDAP_SLAPD_F (int) lload_tls_init( void );
LDAP_SLAPD_F (int) lload_init( int mode, const char *name );
LDAP_SLAPD_F (int) lload_destroy( void );