]> git.sur5r.net Git - openldap/commitdiff
Tweak prev commit, use first unused slot
authorHoward Chu <hyc@openldap.org>
Sat, 2 Jun 2012 12:26:31 +0000 (05:26 -0700)
committerHoward Chu <hyc@openldap.org>
Sat, 2 Jun 2012 12:26:31 +0000 (05:26 -0700)
libraries/libmdb/mdb.c

index ad235f601054f29bc848ee9786f5efbd030df11a..3b0b66fa19aa776cf42c0dd63429b2428265209e 100644 (file)
@@ -6209,7 +6209,7 @@ int mdb_open(MDB_txn *txn, const char *name, unsigned int flags, MDB_dbi *dbi)
        for (i=2; i<txn->mt_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 &&