summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index b18fd91..b4953a9 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3146,8 +3146,10 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
if (enter == NULL)
goto error;
exit = special_lookup(mgr, &PyId___exit__);
- if (exit == NULL)
+ if (exit == NULL) {
+ Py_DECREF(enter);
goto error;
+ }
SET_TOP(exit);
Py_DECREF(mgr);
res = PyObject_CallFunctionObjArgs(enter, NULL);