Skip to content

Fix double decref after failed PyList_SetItem in C tokenizer#361

Open
zivenger wants to merge 1 commit into
earwig:mainfrom
zivenger:fix/pylist-setitem-double-decref
Open

Fix double decref after failed PyList_SetItem in C tokenizer#361
zivenger wants to merge 1 commit into
earwig:mainfrom
zivenger:fix/pylist-setitem-double-decref

Conversation

@zivenger

Copy link
Copy Markdown

PyList_SetItem steals the item reference even on failure, so the error path must not call Py_DECREF on the same object.

Fixes: #360

PyList_SetItem steals the item reference even on failure, so the error path must not call Py_DECREF on the same object.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Double decref after PyList_SetItem() in C tokenizer

1 participant