[issue26168] Py_BuildValue may leak 'N' arguments on PyTuple_New failure

Martin Panter report at bugs.python.org
Fri Jan 29 18:57:13 EST 2016


Martin Panter added the comment:

Left a review.

Squidevil: You say if do_mkvalue() fails, the N object is not released. But looking at the code, I think it gets stored in the tuple, and then the tuple is released: <https://hg.python.org/cpython/file/v3.5.1/Python/modsupport.c#l182>. So the only leak I can see is if the tuple construction fails.

Serhiy’s patch fixes do_mktuple(), but I think the same problem would affect do_mkdict() and do_mklist() as well.

----------
nosy: +martin.panter

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26168>
_______________________________________


More information about the Python-bugs-list mailing list