Issue #19437: Fix PyCFuncPtrType constructor, handle

_ctypes_alloc_format_string() failure
This commit is contained in:
Victor Stinner 2013-10-31 16:34:08 +01:00
parent a215002453
commit e75996a77c

View file

@ -2245,6 +2245,10 @@ PyCFuncPtrType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
argtypes would be a ctypes type).
*/
stgdict->format = _ctypes_alloc_format_string(NULL, "X{}");
if (stgdict->format == NULL) {
Py_DECREF((PyObject *)stgdict);
return NULL;
}
stgdict->flags |= TYPEFLAG_ISPOINTER;
/* create the new instance (which is a class,