From 447683a8244dccdd395d33fa9cf45ac23d10cfc3 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 11 Jan 2016 20:17:42 +0000 Subject: [PATCH] ITS#8346 free last txn0->mt_rpages in env_close --- libraries/liblmdb/mdb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 5ef095f719..bd129c4c2d 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -5255,14 +5255,16 @@ mdb_env_close0(MDB_env *env, int excl) free(env->me_dbflags); free(env->me_path); free(env->me_dirty_list); - free(env->me_txn0); #ifdef MDB_VL32 + if (env->me_txn0 && env->me_txn->mt_rpages) + free(env->me_txn0->mt_rpages); { unsigned int x; for (x=1; x<=env->me_rpages[0].mid; x++) munmap(env->me_rpages[x].mptr, env->me_rpages[x].mcnt * env->me_psize); } free(env->me_rpages); #endif + free(env->me_txn0); mdb_midl_free(env->me_free_pgs); if (env->me_flags & MDB_ENV_TXKEY) { -- 2.39.5