classification
Title: getargs.c: release the buffer on error
Type: Stage:
Components: Interpreter Core Versions: Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: vstinner
Priority: normal Keywords: patch

Created on 2010-06-06 19:11 by vstinner, last changed 2010-06-24 23:06 by vstinner. This issue is now closed.

Files
File name Uploaded Description Edit
getarg_release.patch vstinner, 2010-06-06 19:11
Messages (2)
msg107210 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-06-06 19:11
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 :-)
msg108562 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-06-24 23:06
Fixed in r82206 and r82207.
History
Date User Action Args
2010-06-24 23:06:49vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg108562
2010-06-06 19:11:09vstinnercreate