mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-31861: Fix reference leak in builtin_anext_impl() (GH-25008)
This commit is contained in:
parent
8370e07e1e
commit
a02683ac38
1 changed files with 4 additions and 1 deletions
|
@ -1660,7 +1660,10 @@ builtin_anext_impl(PyObject *module, PyObject *aiterator,
|
|||
return awaitable;
|
||||
}
|
||||
|
||||
return PyAnextAwaitable_New(awaitable, default_value);
|
||||
PyObject* new_awaitable = PyAnextAwaitable_New(
|
||||
awaitable, default_value);
|
||||
Py_DECREF(awaitable);
|
||||
return new_awaitable;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue