]> git.sur5r.net Git - openldap/commitdiff
More cleanup for bdb_db_close
authorHoward Chu <hyc@openldap.org>
Sat, 15 Dec 2001 08:11:59 +0000 (08:11 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 15 Dec 2001 08:11:59 +0000 (08:11 +0000)
servers/slapd/back-bdb/init.c

index 5ee04ab9da390067598f86826c9f0fab3d89d801..4c625435aac47f197d5a6e925e1ad19171a82848 100644 (file)
@@ -317,11 +317,17 @@ bdb_db_close( BackendDB *be )
 {
        int rc;
        struct bdb_info *bdb = (struct bdb_info *) be->be_private;
+       struct bdb_db_info *db;
 
        while( bdb->bi_ndatabases-- ) {
-               rc = bdb->bi_databases[bdb->bi_ndatabases]->bdi_db->close(
-                       bdb->bi_databases[bdb->bi_ndatabases]->bdi_db, 0 );
+               db = bdb->bi_databases[bdb->bi_ndatabases];
+               rc = db->bdi_db->close( db->bdi_db, 0 );
+               if( db->bdi_name )
+                       free( db->bdi_name );
+               free( db );
        }
+       free( bdb->bi_databases );
+       bdb_attr_index_destroy( bdb->bi_attrs );
 
        return 0;
 }