ITS#7917 fix mdb_dbi_open

Don't let dummy go out of scope
vl32
Howard Chu 10 years ago
parent ada2630699
commit 322cd26a7b
  1. 2
      libraries/liblmdb/mdb.c

@ -8892,6 +8892,7 @@ int mdb_dbi_open(MDB_txn *txn, const char *name, unsigned int flags, MDB_dbi *db
MDB_val key, data; MDB_val key, data;
MDB_dbi i; MDB_dbi i;
MDB_cursor mc; MDB_cursor mc;
MDB_db dummy;
int rc, dbflag, exact; int rc, dbflag, exact;
unsigned int unused = 0, seq; unsigned int unused = 0, seq;
size_t len; size_t len;
@ -8961,7 +8962,6 @@ int mdb_dbi_open(MDB_txn *txn, const char *name, unsigned int flags, MDB_dbi *db
return MDB_INCOMPATIBLE; return MDB_INCOMPATIBLE;
} else if (rc == MDB_NOTFOUND && (flags & MDB_CREATE)) { } else if (rc == MDB_NOTFOUND && (flags & MDB_CREATE)) {
/* Create if requested */ /* Create if requested */
MDB_db dummy;
data.mv_size = sizeof(MDB_db); data.mv_size = sizeof(MDB_db);
data.mv_data = &dummy; data.mv_data = &dummy;
memset(&dummy, 0, sizeof(dummy)); memset(&dummy, 0, sizeof(dummy));

Loading…
Cancel
Save