summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/pythonrun.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 084db12..bea7fe1 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);
}