This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author erlendaasland
Recipients erlendaasland, pablogsal
Date 2021-04-08.22:08:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1617919681.12.0.940558119091.issue43779@roundup.psfhosted.org>
In-reply-to
Content
_PyArena_AddPyObject() only steals the object reference if successful.

- In Parser/pegen.c, _PyPegen_fill_token(), the return value is not checked at all.
- In Parser/asdl_c.py, none of the (two) calls to _PyArena_AddPyObject() decref on failure
- Ditto for Python/Python-ast.c


Attached patch fixes all callers. I'll put up a PR if it looks ok.

Alternatively, one could make _PyArena_AddPyObject() _not_ steal the reference, but since it's an exposed API, that's probably not an option.
History
Date User Action Args
2021-04-08 22:08:01erlendaaslandsetrecipients: + erlendaasland, pablogsal
2021-04-08 22:08:01erlendaaslandsetmessageid: <1617919681.12.0.940558119091.issue43779@roundup.psfhosted.org>
2021-04-08 22:08:01erlendaaslandlinkissue43779 messages
2021-04-08 22:08:01erlendaaslandcreate