mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-22 06:43:17 -05:00
Avoid segfault if backend_destroy is called before frontendDB is created
This commit is contained in:
parent
3330aceb0c
commit
f83b55b2a2
1 changed files with 10 additions and 8 deletions
|
|
@ -445,15 +445,17 @@ int backend_destroy(void)
|
|||
|
||||
/* destroy frontend database */
|
||||
bd = frontendDB;
|
||||
if ( bd->bd_info->bi_db_destroy ) {
|
||||
bd->bd_info->bi_db_destroy( bd );
|
||||
if ( bd ) {
|
||||
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 ( bd->be_rootdn.bv_val ) free( bd->be_rootdn.bv_val );
|
||||
if ( bd->be_rootndn.bv_val ) free( bd->be_rootndn.bv_val );
|
||||
if ( bd->be_rootpw.bv_val ) free( bd->be_rootpw.bv_val );
|
||||
acl_destroy( bd->be_acl, frontendDB->be_acl );
|
||||
}
|
||||
ber_bvarray_free( bd->be_suffix );
|
||||
ber_bvarray_free( bd->be_nsuffix );
|
||||
if ( bd->be_rootdn.bv_val ) free( bd->be_rootdn.bv_val );
|
||||
if ( bd->be_rootndn.bv_val ) free( bd->be_rootndn.bv_val );
|
||||
if ( bd->be_rootpw.bv_val ) free( bd->be_rootpw.bv_val );
|
||||
acl_destroy( bd->be_acl, frontendDB->be_acl );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue