Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6a3cedf

Browse files
committed
Issue #29049: Fix refleak introduced by f5eb0c4f5d37.
1 parent fc3723b commit 6a3cedf

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Python/ceval.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4152,8 +4152,11 @@ _PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals,
41524152
} else {
41534153
gen = PyGen_NewWithQualName(f, name, qualname);
41544154
}
4155-
if (gen == NULL)
4155+
if (gen == NULL) {
4156+
Py_DECREF(f);
41564157
return NULL;
4158+
}
4159+
_PyObject_GC_TRACK(f);
41574160

41584161
if (is_coro && coro_wrapper != NULL) {
41594162
PyObject *wrapped;

0 commit comments

Comments
 (0)