From 335294e1902ccc2022e4fb561aac0b29fcff7c7b Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 15 Dec 2001 08:11:59 +0000 Subject: [PATCH] More cleanup for bdb_db_close --- servers/slapd/back-bdb/init.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index 5ee04ab9da..4c625435aa 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -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; } -- 2.39.5