changeset: 105340:749c5d6c4ba5 branch: 3.6 parent: 105338:089886be06df user: Raymond Hettinger date: Tue Nov 22 11:50:40 2016 -0800 files: Python/ceval.c description: Issue #27100: Fix ref leak diff -r 089886be06df -r 749c5d6c4ba5 Python/ceval.c --- a/Python/ceval.c Tue Nov 22 11:48:52 2016 -0800 +++ b/Python/ceval.c Tue Nov 22 11:50:40 2016 -0800 @@ -3138,8 +3138,10 @@ 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);