mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-22 23:59:34 -05:00
Plug mdb_cursor_renew() memleak
This commit is contained in:
parent
c057582573
commit
37bd48a618
1 changed files with 6 additions and 0 deletions
|
|
@ -5840,13 +5840,19 @@ mdb_cursor_open(MDB_txn *txn, MDB_dbi dbi, MDB_cursor **ret)
|
||||||
int
|
int
|
||||||
mdb_cursor_renew(MDB_txn *txn, MDB_cursor *mc)
|
mdb_cursor_renew(MDB_txn *txn, MDB_cursor *mc)
|
||||||
{
|
{
|
||||||
|
unsigned flags;
|
||||||
|
|
||||||
if (txn == NULL || mc == NULL || mc->mc_dbi >= txn->mt_numdbs)
|
if (txn == NULL || mc == NULL || mc->mc_dbi >= txn->mt_numdbs)
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
|
|
||||||
if (txn->mt_cursors)
|
if (txn->mt_cursors)
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
|
|
||||||
|
flags = mc->mc_flags;
|
||||||
|
|
||||||
mdb_cursor_init(mc, txn, mc->mc_dbi, mc->mc_xcursor);
|
mdb_cursor_init(mc, txn, mc->mc_dbi, mc->mc_xcursor);
|
||||||
|
|
||||||
|
mc->mc_flags |= (flags & C_ALLOCD);
|
||||||
return MDB_SUCCESS;
|
return MDB_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue