From: Howard Chu Date: Wed, 3 Aug 2011 10:29:15 +0000 (-0700) Subject: Fix free page re-use X-Git-Tag: OPENLDAP_REL_ENG_2_4_27~148^2~147 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8211dd39603c16bb942a4a3361a55bfc89657263;p=openldap Fix free page re-use --- diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index 5715eac78c..cb12757097 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -398,7 +398,9 @@ mdb_alloc_page(MDB_txn *txn, MDB_page *parent, unsigned int parent_idx, int num) ULONG oldest = txn->mt_txnid - 2; unsigned int i; for (i=0; imt_env->me_txns->mt_numreaders; i++) { - if (txn->mt_env->me_txns->mt_readers[i].mr_txnid < oldest) + ULONG mr = txn->mt_env->me_txns->mt_readers[i].mr_txnid; + if (!mr) continue; + if (mr < oldest) oldest = txn->mt_env->me_txns->mt_readers[i].mr_txnid; } if (oldest > txn->mt_env->me_pghead->mo_txnid) {