From: Howard Chu Date: Wed, 9 Nov 2011 00:45:45 +0000 (-0800) Subject: Fix mdb_drop return X-Git-Tag: OPENLDAP_REL_ENG_2_4_32~125^2~63 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f0c9d7732683b148e6df5a09683e4583fdd3d1fa;p=openldap Fix mdb_drop return --- diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index 32f50fec1e..f3adb66fb0 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -5910,8 +5910,7 @@ int mdb_drop(MDB_txn *txn, MDB_dbi dbi, int del) rc = mdb_drop0(mc, mc->mc_db->md_flags & MDB_DUPSORT); if (rc) - mdb_cursor_close(mc); - return rc; + goto leave; /* Can't delete the main DB */ if (del && dbi > MAIN_DBI) { @@ -5927,6 +5926,7 @@ int mdb_drop(MDB_txn *txn, MDB_dbi dbi, int del) txn->mt_dbs[dbi].md_entries = 0; txn->mt_dbs[dbi].md_root = P_INVALID; } +leave: mdb_cursor_close(mc); return rc; }