summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2016-11-22 11:50:40 -0800
committerRaymond Hettinger <python@rcn.com>2016-11-22 11:50:40 -0800
commitea51eb9cef802e33478f61e5f7eb682f57fafce2 (patch)
tree98644b1041271967f30d6e2ce46359f7cbb8a588 /Python
parentaf9f7d8bc43549e6ba121beecac53fe663ee01ca (diff)
downloadcpython-ea51eb9cef802e33478f61e5f7eb682f57fafce2.tar.gz
Issue #27100: Fix ref leak
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index ebf073a87f..83296f637f 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3138,8 +3138,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);