Author Oren Milman
Recipients Oren Milman
Date 2017-10-14.09:16:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Various __init__() methods don't decref (if needed) before assigning to fields
of the object's struct (i.e. assigning to `self->some_field`):
- _asyncio_Task___init___impl() (in Modules/_asynciomodule.c)
- _lzma_LZMADecompressor___init___impl() (in Modules/_lzmamodule.c)
- _bz2_BZ2Decompressor___init___impl() (in Modules/_bz2module.c)
- EVP_tp_init() (in Modules/_hashopenssl.c)
- property_init_impl() (in Objects/descrobject.c)
- cm_init() (in Objects/funcobject.c)
- sm_init() (in Objects/funcobject.c)

For example, _asyncio_Task___init___impl() does `self->task_coro = coro;`
instead of `Py_XSETREF(self->task_coro, coro);`.
Thus, the following code would result in at least one refleak:
import _asyncio
task = _asyncio.Task('foo')

I would open a PR to fix this soon.
Date User Action Args
2017-10-14 09:16:28Oren Milmansetrecipients: + Oren Milman
2017-10-14 09:16:28Oren Milmansetmessageid: <>
2017-10-14 09:16:28Oren Milmanlinkissue31787 messages
2017-10-14 09:16:27Oren Milmancreate