mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-25 08:12:54 -05:00
Fix valgrind call after malloc failure in mdb.
Also line up the code logic a bit.
This commit is contained in:
parent
d3b9939e71
commit
5c182fbedf
1 changed files with 2 additions and 4 deletions
|
|
@ -1126,13 +1126,11 @@ static MDB_page *
|
|||
mdb_page_malloc(MDB_cursor *mc) {
|
||||
MDB_page *ret;
|
||||
size_t sz = mc->mc_txn->mt_env->me_psize;
|
||||
if (mc->mc_txn->mt_env->me_dpages) {
|
||||
ret = mc->mc_txn->mt_env->me_dpages;
|
||||
if ((ret = mc->mc_txn->mt_env->me_dpages) != NULL) {
|
||||
VGMEMP_ALLOC(mc->mc_txn->mt_env, ret, sz);
|
||||
VGMEMP_DEFINED(ret, sizeof(ret->mp_next));
|
||||
mc->mc_txn->mt_env->me_dpages = ret->mp_next;
|
||||
} else {
|
||||
ret = malloc(sz);
|
||||
} else if ((ret = malloc(sz)) != NULL) {
|
||||
VGMEMP_ALLOC(mc->mc_txn->mt_env, ret, sz);
|
||||
}
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in a new issue