[issue29034] Fix memory leak in path_converter

Serhiy Storchaka report at bugs.python.org
Wed Dec 21 10:32:54 EST 2016


Serhiy Storchaka added the comment:

There are many ways to write a solution of the original issue. You can just add a number of "Py_DECREF(bytes)" (path_converter.patch), or add new variable to_cleanup2 (path_converter-v2.patch), or reuse to_cleanup (path_converter-to_cleanup.patch), or clean ups bytes (path_converter-bytes.patch). All these ways look equivalent.

The issue mentioned in msg283754 is more severe. It can be solved by making path->object referring an original argument (but some code checks the type of path->object), or making path->object owning a reference.

It seems to me that path->narrow can be not initialized for str path on Windows.

----------
nosy: +brett.cannon
Added file: http://bugs.python.org/file45985/path_converter-to_cleanup.patch

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


More information about the Python-bugs-list mailing list