]> granicus.if.org Git - python/commitdiff
Issue #27100: Fix ref leak
authorRaymond Hettinger <python@rcn.com>
Tue, 22 Nov 2016 19:50:40 +0000 (11:50 -0800)
committerRaymond Hettinger <python@rcn.com>
Tue, 22 Nov 2016 19:50:40 +0000 (11:50 -0800)
Python/ceval.c

index ebf073a87fb6b91f763dc435ca64c0c23bf096d2..83296f637fcfa335824f7dec58567ba51b4258b5 100644 (file)
@@ -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);