From 44ac8a35647bec399a92b5d55548be986f6657c7 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 7 Aug 2002 08:43:52 +0000 Subject: [PATCH] Plug config leaks --- servers/slapd/back-bdb/init.c | 5 +++++ servers/slapd/back-bdb/search.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index 5a62a5f11d..ccf50818e6 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -479,6 +479,8 @@ bdb_db_destroy( BackendDB *be ) } } + if( bdb->bi_dbenv_home ) ch_free( bdb->bi_dbenv_home ); + #ifdef BDB_HIER ldap_pvt_thread_rdwr_destroy( &bdb->bi_tree_rdwr ); #endif @@ -487,6 +489,9 @@ bdb_db_destroy( BackendDB *be ) ldap_pvt_thread_mutex_destroy( &bdb->bi_lastid_mutex ); ldap_pvt_thread_mutex_destroy( &bdb->bi_database_mutex ); + ch_free( bdb ); + be->be_private = NULL; + return 0; } diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index 44076d7abe..3bea37794c 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -741,11 +741,11 @@ static int search_candidates( #endif /* Allocate IDL stack, plus 1 more for former tmp */ - stack = malloc( (depth + 1) * BDB_IDL_UM_SIZE * sizeof( ID ) ); + stack = ch_malloc( (depth + 1) * BDB_IDL_UM_SIZE * sizeof( ID ) ); rc = bdb_filter_candidates( be, &f, ids, stack, stack+BDB_IDL_UM_SIZE ); - free( stack ); + ch_free( stack ); if( rc ) { #ifdef NEW_LOGGING -- 2.39.5