diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-03-25 23:26:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-25 23:26:42 -0700 |
commit | e0fe25be1ecbdf4abd1b0edd4aabacc4d75dec41 (patch) | |
tree | 083880c823f50dad1e443e4a34afcf2b7d5f16ee /Modules | |
parent | eb94e5b3ec01a34af1087c4c85568b5d20325892 (diff) | |
download | cpython-git-e0fe25be1ecbdf4abd1b0edd4aabacc4d75dec41.tar.gz |
bpo-36430: Fix a possible reference leak in itertools.count(). (GH-12551)
(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 1113fb6b76..bff9df6083 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -4027,6 +4027,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; |