summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2016-11-22 19:50:40 (GMT)
committerRaymond Hettinger <python@rcn.com>2016-11-22 19:50:40 (GMT)
commit64e2f9ac86b0f7aade2fe331136beceee975fc91 (patch)
tree815acf15f2eaca9b6d833398643d683b48434e14 /Python
parent02a4018c6e375cfa8d828fa7f4c34c9de82a3df2 (diff)
downloadcpython-64e2f9ac86b0f7aade2fe331136beceee975fc91.zip
cpython-64e2f9ac86b0f7aade2fe331136beceee975fc91.tar.gz
cpython-64e2f9ac86b0f7aade2fe331136beceee975fc91.tar.bz2
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 ebf073a..83296f6 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);