diff options
author | INADA Naoki <songofacandy@gmail.com> | 2016-12-26 09:01:46 (GMT) |
---|---|---|
committer | INADA Naoki <songofacandy@gmail.com> | 2016-12-26 09:01:46 (GMT) |
commit | 6a3cedf8dd4ab85e426ce472974892d5c6804c16 (patch) | |
tree | 35b0d12532ff9e871c398862e78170589b0b1570 | |
parent | fc3723bbf6289c9c02f5f8af6f0786230fb66c8d (diff) | |
download | cpython-6a3cedf8dd4ab85e426ce472974892d5c6804c16.zip cpython-6a3cedf8dd4ab85e426ce472974892d5c6804c16.tar.gz cpython-6a3cedf8dd4ab85e426ce472974892d5c6804c16.tar.bz2 |
Issue #29049: Fix refleak introduced by f5eb0c4f5d37.
-rw-r--r-- | Python/ceval.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index e48586d..08fc27f 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4152,8 +4152,11 @@ _PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals, } else { gen = PyGen_NewWithQualName(f, name, qualname); } - if (gen == NULL) + if (gen == NULL) { + Py_DECREF(f); return NULL; + } + _PyObject_GC_TRACK(f); if (is_coro && coro_wrapper != NULL) { PyObject *wrapped; |