Kaydet (Commit) e75996a7 authored tarafından Victor Stinner's avatar Victor Stinner

Issue #19437: Fix PyCFuncPtrType constructor, handle

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