- LDAP_TAILQ_REMOVE( bd->be_pending_csn_list, csne, ce_csn_link );
- ch_free( csne->ce_csn.bv_val );
- csne = LDAP_TAILQ_NEXT( csne, ce_csn_link );
- ch_free( tmp_csne );
- }
- }
-
- if ( bd->bd_info->bi_db_destroy ) {
- bd->bd_info->bi_db_destroy( bd );
- }
- ber_bvarray_free( bd->be_suffix );
- ber_bvarray_free( bd->be_nsuffix );
- if ( !BER_BVISNULL( &bd->be_rootdn ) ) {
- free( bd->be_rootdn.bv_val );
- }
- if ( !BER_BVISNULL( &bd->be_rootndn ) ) {
- free( bd->be_rootndn.bv_val );
- }
- if ( !BER_BVISNULL( &bd->be_rootpw ) ) {
- free( bd->be_rootpw.bv_val );
- }
- acl_destroy( bd->be_acl, frontendDB->be_acl );
- if ( bd->be_controls ) {
- ldap_charray_free( bd->be_controls );
- }
+ backend_stopdown_one( bd );
+
+ ber_bvarray_free( bd->be_suffix );
+ ber_bvarray_free( bd->be_nsuffix );
+ if ( !BER_BVISNULL( &bd->be_rootdn ) ) {
+ free( bd->be_rootdn.bv_val );
+ }
+ if ( !BER_BVISNULL( &bd->be_rootndn ) ) {
+ free( bd->be_rootndn.bv_val );
+ }
+ if ( !BER_BVISNULL( &bd->be_rootpw ) ) {
+ free( bd->be_rootpw.bv_val );
+ }
+ acl_destroy( bd->be_acl, frontendDB->be_acl );
+ limits_destroy( bd->be_limits );
+ if ( bd->be_replogfile ) {
+ ch_free( bd->be_replogfile );
+ }
+ if ( bd->be_replica_argsfile ) {
+ ch_free( bd->be_replica_argsfile );
+ }
+ if ( bd->be_replica_pidfile ) {
+ ch_free( bd->be_replica_pidfile );
+ }
+ destroy_replica_info( bd );
+ if ( !BER_BVISNULL( &bd->be_update_ndn ) ) {
+ ch_free( bd->be_update_ndn.bv_val );
+ }
+ if ( bd->be_update_refs ) {
+ ber_bvarray_free( bd->be_update_refs );