diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2008-08-29 18:39:48 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2008-08-29 18:39:48 (GMT) |
commit | d4ae97bc38780aab5f348b73fee67eaab7546441 (patch) | |
tree | 62ef9d69e065bea64123dc4493ee955ac8553499 /Include | |
parent | a27e89bd04d8423dde480a9832400401b38bfc68 (diff) | |
download | cpython-d4ae97bc38780aab5f348b73fee67eaab7546441.zip cpython-d4ae97bc38780aab5f348b73fee67eaab7546441.tar.gz cpython-d4ae97bc38780aab5f348b73fee67eaab7546441.tar.bz2 |
#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.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/cobject.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Include/cobject.h b/Include/cobject.h index 499dfad..4e24d7d 100644 --- a/Include/cobject.h +++ b/Include/cobject.h @@ -48,6 +48,15 @@ PyAPI_FUNC(void *) PyCObject_Import(char *module_name, char *cobject_name); /* Modify a C object. Fails (==0) if object has a destructor. */ PyAPI_FUNC(int) PyCObject_SetVoidPtr(PyObject *self, void *cobj); + +typedef struct { + PyObject_HEAD + void *cobject; + void *desc; + void (*destructor)(void *); +} PyCObject; + + #ifdef __cplusplus } #endif |