ITS#7987 fix excessive space for single write txn

vl32b
Leo Yuriev 10 years ago committed by Howard Chu
parent c36c167cc4
commit 1a7243b3f4
  1. 2
      libraries/liblmdb/mdb.c

@ -4603,7 +4603,7 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode
if (!(flags & MDB_RDONLY)) { if (!(flags & MDB_RDONLY)) {
MDB_txn *txn; MDB_txn *txn;
int tsize = sizeof(MDB_txn), size = tsize + env->me_maxdbs * int tsize = sizeof(MDB_txn), size = tsize + env->me_maxdbs *
(sizeof(MDB_db)+sizeof(MDB_cursor)+sizeof(unsigned int)+1); (sizeof(MDB_db)+sizeof(MDB_cursor *)+sizeof(unsigned int)+1);
txn = calloc(1, size); txn = calloc(1, size);
if (txn) { if (txn) {
txn->mt_dbs = (MDB_db *)((char *)txn + tsize); txn->mt_dbs = (MDB_db *)((char *)txn + tsize);

Loading…
Cancel
Save