Skip to content

Commit 64e2f9a

Browse files
committed
Issue #27100: Fix ref leak
1 parent 02a4018 commit 64e2f9a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Python/ceval.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3138,8 +3138,10 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
31383138
if (enter == NULL)
31393139
goto error;
31403140
exit = special_lookup(mgr, &PyId___exit__);
3141-
if (exit == NULL)
3141+
if (exit == NULL) {
3142+
Py_DECREF(enter);
31423143
goto error;
3144+
}
31433145
SET_TOP(exit);
31443146
Py_DECREF(mgr);
31453147
res = PyObject_CallFunctionObjArgs(enter, NULL);

0 commit comments

Comments
 (0)