From 7d643d3acb94a6d7306330b550fce0e5755444a9 Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Sun, 31 Mar 2013 23:50:02 +0200 Subject: [PATCH] Plug MDB memory leak of DB names. --- libraries/liblmdb/mdb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index dff463b..438838f 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -3707,10 +3707,14 @@ void mdb_env_close(MDB_env *env) { MDB_page *dp; + int i; if (env == NULL) return; + for (i = env->me_numdbs; --i > MAIN_DBI; ) + free(env->me_dbxs[i].md_name.mv_data); + VGMEMP_DESTROY(env); while ((dp = env->me_dpages) != NULL) { VGMEMP_DEFINED(&dp->mp_next, sizeof(dp->mp_next));