From 58e4eda1c6d1fc90e2542393ee4e2aac5f55bf42 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Thu, 21 Jan 2021 20:28:03 +0300 Subject: [PATCH] mdbx: fix spilled page list memleak. Change-Id: I8b3b3664711943b0809be7bcc6580aafd4e4c286 --- src/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core.c b/src/core.c index b907e402..eff491a9 100644 --- a/src/core.c +++ b/src/core.c @@ -7390,6 +7390,8 @@ static int mdbx_txn_end(MDBX_txn *txn, const unsigned mode) { txn->mt_flags = MDBX_TXN_FINISHED; txn->mt_owner = 0; env->me_txn = txn->mt_parent; + mdbx_pnl_free(txn->tw.spill_pages); + txn->tw.spill_pages = nullptr; if (txn == env->me_txn0) { mdbx_assert(env, txn->mt_parent == NULL); /* Export or close DBI handles created in this txn */ @@ -7434,7 +7436,6 @@ static int mdbx_txn_end(MDBX_txn *txn, const unsigned mode) { mdbx_dlist_free(txn); mdbx_dpl_free(txn); mdbx_pnl_free(txn->tw.reclaimed_pglist); - mdbx_pnl_free(txn->tw.spill_pages); if (parent->mt_geo.upper != txn->mt_geo.upper || parent->mt_geo.now != txn->mt_geo.now) {