From: Howard Chu Date: Thu, 25 Aug 2005 03:00:29 +0000 (+0000) Subject: Must close env before removing it. X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~583 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=143a1cdae147573243692062267537e42e3e3a14;p=openldap Must close env before removing it. --- diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index 014ed2d30a..33ef87d559 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -278,6 +278,15 @@ bdb_db_open( BackendDB *be ) } /* Prev environment had TXN support, get rid of it */ if ( !flags_ok ) { + bdb->bi_dbenv->close( bdb->bi_dbenv, 0 ); + bdb->bi_dbenv = NULL; + rc = db_env_create( &bdb->bi_dbenv, 0 ); + if( rc != 0 ) { + Debug( LDAP_DEBUG_ANY, + "bdb_db_open: db_env_create failed: %s (%d)\n", + db_strerror(rc), rc, 0 ); + return rc; + } bdb->bi_dbenv->remove( bdb->bi_dbenv, dbhome, 0 ); bdb->bi_dbenv = NULL; }