Issue #29049: Fix refleak introduced by f5eb0c4f5d37.

This commit is contained in:
INADA Naoki 2016-12-26 18:01:46 +09:00
parent fc3723bbf6
commit 6a3cedf8dd
1 changed files with 4 additions and 1 deletions

View File

@ -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;