[New-bugs-announce] [issue8926] getargs.c: release the buffer on error

STINNER Victor report at bugs.python.org
Sun Jun 6 21:11:10 CEST 2010


New submission from STINNER Victor <victor.stinner at haypocalc.com>:

PyArg_ParseTuple("t") calls PyObject_GetBuffer() and then raise an error if arg->ob_type->tp_as_buffer->bf_releasebuffer is not NULL. I think that it should call PyBuffer_Release(&view) before raising the error, or simply check bf_releasebuffer before calling PyObject_GetBuffer().

getbuffer() calls PyObject_GetBuffer() and then raise an error if the buffer is not contiguous. I think that it should call PyBuffer_Release() before the error.

Attached patch fixes both errors.

Tell me if I'm wrong :-)

----------
components: Interpreter Core
files: getarg_release.patch
keywords: patch
messages: 107210
nosy: haypo
priority: normal
severity: normal
status: open
title: getargs.c: release the buffer on error
versions: Python 3.2
Added file: http://bugs.python.org/file17577/getarg_release.patch

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


More information about the New-bugs-announce mailing list