diff options
author | Mat M <mathew1800@gmail.com> | 2017-11-14 01:00:54 -0500 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-11-14 08:00:54 +0200 |
commit | 56935a53b11b9a70f3e13e460777ec81a5b9195e (patch) | |
tree | e89fe45233b26c462be5efc4a526ae191b2c327e /Modules/arraymodule.c | |
parent | 28b624825eb92cb8c96fbf8da267d8d14a61a841 (diff) | |
download | cpython-git-56935a53b11b9a70f3e13e460777ec81a5b9195e.tar.gz |
bpo-32020: arraymodule: Correct missing Py_DECREF in failure case of make_array() (#4391)
Diffstat (limited to 'Modules/arraymodule.c')
-rw-r--r-- | Modules/arraymodule.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index 4f778a2dea..8c3f0a1c6c 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -1928,8 +1928,10 @@ make_array(PyTypeObject *arraytype, char typecode, PyObject *items) return NULL; new_args = PyTuple_New(2); - if (new_args == NULL) + if (new_args == NULL) { + Py_DECREF(typecode_obj); return NULL; + } Py_INCREF(items); PyTuple_SET_ITEM(new_args, 0, typecode_obj); PyTuple_SET_ITEM(new_args, 1, items); |