mirror of
https://github.com/python/cpython.git
synced 2026-01-04 14:32:21 +00:00
Issue #19437: Fix error handling of PyCArrayType_new(), don't decreases the
reference counter of stgdict after result stole a reference to it
This commit is contained in:
parent
2399ad51d4
commit
e106e5ce4b
1 changed files with 2 additions and 1 deletions
|
|
@ -1342,7 +1342,8 @@ PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
if (-1 == PyDict_Update((PyObject *)stgdict, result->tp_dict))
|
||||
goto error;
|
||||
Py_DECREF(result->tp_dict);
|
||||
result->tp_dict = (PyObject *)stgdict;
|
||||
result->tp_dict = (PyObject *)stgdict; /* steal the reference */
|
||||
stgdict = NULL;
|
||||
|
||||
/* Special case for character arrays.
|
||||
A permanent annoyance: char arrays are also strings!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue