mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
don't crash if no underlying database was initialized
This commit is contained in:
parent
38968623d1
commit
5128702536
@ -4051,7 +4051,10 @@ config_back_db_close( BackendDB *be )
|
||||
cfb_free_entries( cfb->cb_root );
|
||||
cfb->cb_root = NULL;
|
||||
|
||||
backend_shutdown( &cfb->cb_db );
|
||||
if ( cfb->cb_db.bd_info ) {
|
||||
backend_shutdown( &cfb->cb_db );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -4066,13 +4069,17 @@ config_back_db_destroy( BackendDB *be )
|
||||
|
||||
avl_free( CfOcTree, NULL );
|
||||
|
||||
cfb->cb_db.be_suffix = NULL;
|
||||
cfb->cb_db.be_nsuffix = NULL;
|
||||
cfb->cb_db.be_rootdn.bv_val = NULL;
|
||||
cfb->cb_db.be_rootndn.bv_val = NULL;
|
||||
backend_destroy_one( &cfb->cb_db, 0 );
|
||||
if ( cfb->cb_db.bd_info ) {
|
||||
cfb->cb_db.be_suffix = NULL;
|
||||
cfb->cb_db.be_nsuffix = NULL;
|
||||
BER_BVZERO( &cfb->cb_db.be_rootdn );
|
||||
BER_BVZERO( &cfb->cb_db.be_rootndn );
|
||||
|
||||
backend_destroy_one( &cfb->cb_db, 0 );
|
||||
}
|
||||
|
||||
free( be->be_private );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user