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

Serhiy Storchaka report at bugs.python.org
Sun May 15 08:52:00 EDT 2016


Serhiy Storchaka added the comment:

I'm not happy with pybuildvalue_leak3.patch. For failed keys it saves values with the same key (None). This means that old value can be deallocated before the end of building all dict.

Following patch collects all values after error in a tuple. This not only fixes the issue with building dict, but makes the code for building tuple, list and dict cleaner. It no longer contains the code for processing after error, it is moved in separate function.

----------
Added file: http://bugs.python.org/file42858/pybuildvalue_leak4.patch

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


More information about the Python-bugs-list mailing list