bpo-36430: Fix a possible reference leak in itertools.count(). (GH-12551)
This commit is contained in:
parent
3e700e4ca3
commit
0523c39e77
|
@ -0,0 +1 @@
|
|||
Fix a possible reference leak in :func:`itertools.count`.
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue