- if ( li->url != NULL ) {
- ch_free( li->url );
- li->url = NULL;
- }
- if ( li->lud ) {
- ldap_free_urldesc( li->lud );
- li->lud = NULL;
- }
- if ( !BER_BVISNULL( &li->acl_authcID ) ) {
- ch_free( li->acl_authcID.bv_val );
- BER_BVZERO( &li->acl_authcID );
- }
- if ( !BER_BVISNULL( &li->acl_authcDN ) ) {
- ch_free( li->acl_authcDN.bv_val );
- BER_BVZERO( &li->acl_authcDN );
- }
- if ( !BER_BVISNULL( &li->acl_passwd ) ) {
- ch_free( li->acl_passwd.bv_val );
- BER_BVZERO( &li->acl_passwd );
- }
- if ( !BER_BVISNULL( &li->acl_sasl_mech ) ) {
- ch_free( li->acl_sasl_mech.bv_val );
- BER_BVZERO( &li->acl_sasl_mech );
- }
- if ( !BER_BVISNULL( &li->acl_sasl_realm ) ) {
- ch_free( li->acl_sasl_realm.bv_val );
- BER_BVZERO( &li->acl_sasl_realm );
- }
- if ( !BER_BVISNULL( &li->idassert_authcID ) ) {
- ch_free( li->idassert_authcID.bv_val );
- BER_BVZERO( &li->idassert_authcID );
- }
- if ( !BER_BVISNULL( &li->idassert_authcDN ) ) {
- ch_free( li->idassert_authcDN.bv_val );
- BER_BVZERO( &li->idassert_authcDN );
- }
- if ( !BER_BVISNULL( &li->idassert_passwd ) ) {
- ch_free( li->idassert_passwd.bv_val );
- BER_BVZERO( &li->idassert_passwd );
+int
+ldap_back_db_destroy( Backend *be, ConfigReply *cr )
+{
+ if ( be->be_private ) {
+ ldapinfo_t *li = ( ldapinfo_t * )be->be_private;
+ unsigned i;
+
+ (void)ldap_back_monitor_db_destroy( be );
+
+ ldap_pvt_thread_mutex_lock( &li->li_conninfo.lai_mutex );
+
+ if ( li->li_uri != NULL ) {
+ ch_free( li->li_uri );
+ li->li_uri = NULL;
+
+ assert( li->li_bvuri != NULL );
+ ber_bvarray_free( li->li_bvuri );
+ li->li_bvuri = NULL;