diff Python/pythonrun.c @ 72424:ad0804d3dbd0

- Issue #13021: Missing decref on an error path. Thanks to Suman Saha for finding the bug and providing a patch.
author Barry Warsaw <barry@python.org>
date Tue, 20 Sep 2011 14:58:01 -0400
parents 7ce685cda0ae 7a48e98915f2
children 5e33219492bc
line wrap: on
line diff
--- a/Python/pythonrun.c	Tue Sep 20 19:27:39 2011 +0200
+++ b/Python/pythonrun.c	Tue Sep 20 14:58:01 2011 -0400
@@ -1251,8 +1251,10 @@
             Py_DECREF(f);
             return -1;
         }
-        if (PyDict_SetItemString(d, "__cached__", Py_None) < 0)
+        if (PyDict_SetItemString(d, "__cached__", Py_None) < 0) {
+            Py_DECREF(f);
             return -1;
+        }
         set_file_name = 1;
         Py_DECREF(f);
     }