Commit 5e333784 authored by Zackery Spytz's avatar Zackery Spytz Committed by Serhiy Storchaka

bpo-36421: Fix a possible double decref in _ctypes.c's PyCArrayType_new(). (GH-12530)

Set type_attr to NULL after the assignment to stgdict->proto (like
what is done with stgdict after the Py_SETREF() call) so that it is
not decrefed twice on error.
parent dd5417af
Fix a possible double decref in _ctypes.c's ``PyCArrayType_new()``.
......@@ -1522,6 +1522,7 @@ PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
stgdict->align = itemalign;
stgdict->length = length;
stgdict->proto = type_attr;
type_attr = NULL;
stgdict->paramfunc = &PyCArrayType_paramfunc;
......
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