#3668: 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.

Reviewed by Amaury Forgeot d'Arc.
This commit is contained in:
Antoine Pitrou 2008-08-29 18:37:05 +00:00
parent db26f7c137
commit f7199578be
4 changed files with 59 additions and 22 deletions

View file

@ -9,13 +9,6 @@
typedef void (*destructor1)(void *);
typedef void (*destructor2)(void *, void*);
typedef struct {
PyObject_HEAD
void *cobject;
void *desc;
void (*destructor)(void *);
} PyCObject;
PyObject *
PyCObject_FromVoidPtr(void *cobj, void (*destr)(void *))
{