mdb_dbi_close() must allow any dbi < maxdbs, since opens in an
uncommitted txn don't increment env->me_numdbs.
vmware
Howard Chu 12 years ago
parent e43fa77eaa
commit fbe6a6051b
  1. 2
      libraries/liblmdb/mdb.c

@ -7168,7 +7168,7 @@ int mdb_stat(MDB_txn *txn, MDB_dbi dbi, MDB_stat *arg)
void mdb_dbi_close(MDB_env *env, MDB_dbi dbi) void mdb_dbi_close(MDB_env *env, MDB_dbi dbi)
{ {
char *ptr; char *ptr;
if (dbi <= MAIN_DBI || dbi >= env->me_numdbs) if (dbi <= MAIN_DBI || dbi >= env->me_maxdbs)
return; return;
ptr = env->me_dbxs[dbi].md_name.mv_data; 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_data = NULL;

Loading…
Cancel
Save