From 916048d7807b179cbf839346768516bfdaeadecf Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Tue, 20 Sep 2011 14:45:44 -0400 Subject: - Issue #13021: Missing decref on an error path. Thanks to Suman Saha for finding the bug and providing a patch. --- Python/pythonrun.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Python/pythonrun.c') diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 084db12f63..bea7fe1544 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1241,8 +1241,10 @@ PyRun_SimpleFileExFlags(FILE *fp, const char *filename, int closeit, 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); } -- cgit v1.2.1