bpo-32020: arraymodule: Correct missing Py_DECREF in failure case of … · python/cpython@18056fb (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Commit 18056fb
authored and
committed
File tree
1 file changed
lines changed
1 file changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1885,8 +1885,10 @@ make_array(PyTypeObject *arraytype, char typecode, PyObject *items) | ||
1885 | 1885 | return NULL; |
1886 | 1886 | |
1887 | 1887 | new_args = PyTuple_New(2); |
1888 | -if (new_args == NULL) | |
1888 | +if (new_args == NULL) { | |
1889 | +Py_DECREF(typecode_obj); | |
1889 | 1890 | return NULL; |
1891 | + } | |
1890 | 1892 | Py_INCREF(items); |
1891 | 1893 | PyTuple_SET_ITEM(new_args, 0, typecode_obj); |
1892 | 1894 | PyTuple_SET_ITEM(new_args, 1, items); |