Skip to content

Commit 56935a5

Browse files
lioncashserhiy-storchaka
authored andcommitted
bpo-32020: arraymodule: Correct missing Py_DECREF in failure case of make_array() (#4391)
1 parent 28b6248 commit 56935a5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Modules/arraymodule.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1928,8 +1928,10 @@ make_array(PyTypeObject *arraytype, char typecode, PyObject *items)
19281928
return NULL;
19291929

19301930
new_args = PyTuple_New(2);
1931-
if (new_args == NULL)
1931+
if (new_args == NULL) {
1932+
Py_DECREF(typecode_obj);
19321933
return NULL;
1934+
}
19331935
Py_INCREF(items);
19341936
PyTuple_SET_ITEM(new_args, 0, typecode_obj);
19351937
PyTuple_SET_ITEM(new_args, 1, items);

0 commit comments

Comments
 (0)