diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2021-03-24 01:42:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-24 01:42:13 (GMT) |
commit | a02683ac38183fa3a45c32319dfd329c5e622f0e (patch) | |
tree | e69586260419b20d7ea13037e58dcccc9dec1b2d | |
parent | 8370e07e1e5b626e78ddc7aadbfaf248976c4454 (diff) | |
download | cpython-a02683ac38183fa3a45c32319dfd329c5e622f0e.zip cpython-a02683ac38183fa3a45c32319dfd329c5e622f0e.tar.gz cpython-a02683ac38183fa3a45c32319dfd329c5e622f0e.tar.bz2 |
bpo-31861: Fix reference leak in builtin_anext_impl() (GH-25008)
-rw-r--r-- | Python/bltinmodule.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index d08e9a3..a076006 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -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; } |