Commit eda77c22 authored by Victor Stinner's avatar Victor Stinner

Issue #19437: Fix PyCFuncPtrType constructor, handle

_ctypes_alloc_format_string() failure
parent 5717ac53
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment