[issue3668] "s*" argument parser marker leaks memory
Amaury Forgeot d'Arc
report at bugs.python.org
Sun Aug 24 23:02:58 CEST 2008
New submission from Amaury Forgeot d'Arc <amauryfa at gmail.com>:
When PyArg_ParseTuple correctly parses a s* format, but raises an
exception afterwards (for a subsequent parameter), the user code will
not call PyBuffer_Release() and memory will leak.
Seen by "regrtest -R:: test_binascii"
For example:
>>> binascii.a2b_qp("", **{1:1})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: keywords must be strings
[42278 refs]
>>> binascii.a2b_qp("", **{1:1})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: keywords must be strings
[42279 refs]
>>> binascii.a2b_qp("", **{1:1})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: keywords must be strings
[42280 refs]
The same pattern was correctly handled by the "et#" type (where the user
has to call PyMem_Free) with the help of a cleanup list (see the
addcleanup() function in getargs.c). (See issue501716)
----------
messages: 71870
nosy: amaury.forgeotdarc
priority: release blocker
severity: normal
status: open
title: "s*" argument parser marker leaks memory
versions: Python 3.0
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3668>
_______________________________________
More information about the Python-bugs-list
mailing list