diff Python/pythonrun.c @ 72423:7a48e98915f2 3.2

- 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:45:44 -0400
parents 7089afd69a1a
children 150e096095e5 ad0804d3dbd0
line wrap: on
line diff
--- a/Python/pythonrun.c	Mon Sep 19 19:18:37 2011 +0100
+++ b/Python/pythonrun.c	Tue Sep 20 14:45:44 2011 -0400
@@ -1241,8 +1241,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);
     }