Skip to content

Commit

Permalink
Try to recover from closing a freed cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Jan 21, 2025
1 parent 447c167 commit e764d2c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dependencies/lmdb/libraries/liblmdb/mdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -10357,6 +10357,11 @@ void
mdb_cursor_close(MDB_cursor *mc)
{
if (mc) {
if (!mc->mc_txn || !mc->mc_txn->mt_env) {
fprintf(stderr, "cursor_close: mc->mc_txn or mc->mc_txn->mt_env is NULL, ensure that cursors are closed before the transaction is closed\n");
free(mc);
return;
}
MDB_CURSOR_UNREF(mc, 0);
}
if (mc && !mc->mc_backup) {
Expand Down

0 comments on commit e764d2c

Please sign in to comment.