From: Howard Chu Date: Sat, 2 Jun 2012 12:26:31 +0000 (-0700) Subject: Tweak prev commit, use first unused slot X-Git-Tag: OPENLDAP_REL_ENG_2_4_32~102^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a334257800bc30810e4ed4da7fd2681c1f765821;p=openldap Tweak prev commit, use first unused slot --- diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index ad235f6010..3b0b66fa19 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -6209,7 +6209,7 @@ int mdb_open(MDB_txn *txn, const char *name, unsigned int flags, MDB_dbi *dbi) for (i=2; imt_numdbs; i++) { if (!txn->mt_dbxs[i].md_name.mv_size) { /* Remember this free slot */ - unused = i; + if (!unused) unused = i; continue; } if (len == txn->mt_dbxs[i].md_name.mv_size &&