mirror of
https://github.com/python/cpython.git
synced 2026-04-22 03:41:08 +00:00
bpo-36430: Fix a possible reference leak in itertools.count(). (GH-12551)
(cherry picked from commit 0523c39e77)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
This commit is contained in:
parent
eb94e5b3ec
commit
e0fe25be1e
2 changed files with 2 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
Fix a possible reference leak in :func:`itertools.count`.
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue