]> git.sur5r.net Git - openldap/commitdiff
ITS#3992 check bi_dbenv
authorHoward Chu <hyc@openldap.org>
Thu, 1 Sep 2005 12:15:30 +0000 (12:15 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 1 Sep 2005 12:15:30 +0000 (12:15 +0000)
servers/slapd/back-bdb/init.c

index e7417c7faad45fb56f277480f935f07783616e4c..36af08c8e5d03e6fe3e42ff3949172c949718b4b 100644 (file)
@@ -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,