From: Howard Chu Date: Thu, 1 Sep 2005 12:15:30 +0000 (+0000) Subject: ITS#3992 check bi_dbenv X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~508 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8eed3a4bb5936e3bdac0125eb6529a866c656197;p=openldap ITS#3992 check bi_dbenv --- 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,