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.
This commit is contained in:
parent
dd5417afcf
commit
5e333784f0
|
@ -0,0 +1 @@
|
|||
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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue