From 8eed3a4bb5936e3bdac0125eb6529a866c656197 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 1 Sep 2005 12:15:30 +0000 Subject: [PATCH] ITS#3992 check bi_dbenv --- servers/slapd/back-bdb/init.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index e7417c7faa..36af08c8e5 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -312,8 +312,10 @@ bdb_db_open( BackendDB *be ) open_env = 0; } else { /* Create a new env that can take the desired settings */ - bdb->bi_dbenv->close( bdb->bi_dbenv, 0 ); - bdb->bi_dbenv = NULL; + if ( bdb->bi_dbenv != NULL ) { + 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, -- 2.39.5