diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-03-26 07:55:35 (GMT) |
---|---|---|
committer | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2019-03-26 07:55:35 (GMT) |
commit | c0dce6aa2ce1ff408170bb8de2ebde3bfd8aa6cf (patch) | |
tree | f251cf46dda4bd53e3225309af3dad1821ebaa3e /Modules | |
parent | bd96393cda54044d81054225dcfc1b26374589a8 (diff) | |
download | cpython-c0dce6aa2ce1ff408170bb8de2ebde3bfd8aa6cf.zip cpython-c0dce6aa2ce1ff408170bb8de2ebde3bfd8aa6cf.tar.gz cpython-c0dce6aa2ce1ff408170bb8de2ebde3bfd8aa6cf.tar.bz2 |
bpo-36430: Fix a possible reference leak in itertools.count(). (GH-12551) (GH-12554)
(cherry picked from commit 0523c39e7720b82b38ad793d3f1a5681adcdf873)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/itertoolsmodule.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index 47db7af..04076fd 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -3321,6 +3321,7 @@ count_new(PyTypeObject *type, PyObject *args, PyObject *kwds) lz = (countobject *)type->tp_alloc(type, 0); if (lz == NULL) { Py_XDECREF(long_cnt); + Py_DECREF(long_step); return NULL; } lz->cnt = cnt; |