Skip to content
Snippets Groups Projects
Commit ca7ba1a3 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Fix slapadd crash when only a subset of databases have been initialized.

Likely should have a general solution to this.
parent 4362654e
No related branches found
No related tags found
No related merge requests found
......@@ -252,13 +252,15 @@ bdb_db_destroy( BackendDB *be )
struct bdb_info *bdb = (struct bdb_info *) be->be_private;
/* close db environment */
rc = bdb->bi_dbenv->close( bdb->bi_dbenv, 0 );
bdb->bi_dbenv = NULL;
if( rc != 0 ) {
Debug( LDAP_DEBUG_ANY,
"bdb_db_destroy: close failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
return rc;
if( bdb->bi_dbenv ) {
rc = bdb->bi_dbenv->close( bdb->bi_dbenv, 0 );
bdb->bi_dbenv = NULL;
if( rc != 0 ) {
Debug( LDAP_DEBUG_ANY,
"bdb_db_destroy: close failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
return rc;
}
}
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment