From: Hallvard Furuseth Date: Sat, 4 May 2013 08:03:19 +0000 (+0200) Subject: Update fixes for dbi_open/close, ITS#7515. X-Git-Tag: OPENLDAP_REL_ENG_2_4_36~68^2~12 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=151c416b460b02cd96502a47189cda19ab651ada;p=openldap Update fixes for dbi_open/close, ITS#7515. Reset me_dbflags[dbi] when closing DBI, to get rid of MDB_VALID flag. mdb_env_close(): Re-fix DB-name memleak. DBIs > me_numdbs may exist. --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 7d4383f886..96ca73fb03 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -2003,6 +2003,7 @@ mdb_txn_reset0(MDB_txn *txn) char *ptr = env->me_dbxs[i].md_name.mv_data; env->me_dbxs[i].md_name.mv_data = NULL; env->me_dbxs[i].md_name.mv_size = 0; + env->me_dbflags[i] = 0; free(ptr); } } @@ -3761,7 +3762,7 @@ mdb_env_close(MDB_env *env) if (env == NULL) return; - for (i = env->me_numdbs; --i > MAIN_DBI; ) + for (i = env->me_maxdbs; --i > MAIN_DBI; ) free(env->me_dbxs[i].md_name.mv_data); VGMEMP_DESTROY(env); @@ -7226,6 +7227,7 @@ void mdb_dbi_close(MDB_env *env, MDB_dbi dbi) ptr = env->me_dbxs[dbi].md_name.mv_data; env->me_dbxs[dbi].md_name.mv_data = NULL; env->me_dbxs[dbi].md_name.mv_size = 0; + env->me_dbflags[dbi] = 0; free(ptr); }