summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2019-03-26 06:05:29 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2019-03-26 06:05:29 (GMT)
commit0523c39e7720b82b38ad793d3f1a5681adcdf873 (patch)
treeba1647c6e08c27a50358fa27ec42b1ace4fab764 /Modules
parent3e700e4ca3922337a24dc150238a6da724cfe873 (diff)
downloadcpython-0523c39e7720b82b38ad793d3f1a5681adcdf873.zip
cpython-0523c39e7720b82b38ad793d3f1a5681adcdf873.tar.gz
cpython-0523c39e7720b82b38ad793d3f1a5681adcdf873.tar.bz2
bpo-36430: Fix a possible reference leak in itertools.count(). (GH-12551)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/itertoolsmodule.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 536f7fa..103029d 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -4089,6 +4089,7 @@ itertools_count_impl(PyTypeObject *type, PyObject *long_cnt,
lz = (countobject *)type->tp_alloc(type, 0);
if (lz == NULL) {
Py_XDECREF(long_cnt);
+ Py_DECREF(long_step);
return NULL;
}
lz->cnt = cnt;