summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2011-09-20 14:58:01 -0400
committerBarry Warsaw <barry@python.org>2011-09-20 14:58:01 -0400
commit57c78077fcbd997a62f6ce408b74e724d4cc6ded (patch)
treea6081966226d972bd6f18258cf27782167dfc3b9 /Python/pythonrun.c
parentaa253acaa212426f38c64ac2a1c7f06c75f70781 (diff)
parent98292273d840a24a366ab585f907da593c0726e0 (diff)
downloadcpython-57c78077fcbd997a62f6ce408b74e724d4cc6ded.tar.gz
- Issue #13021: Missing decref on an error path. Thanks to Suman Saha for
finding the bug and providing a patch.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 5649e86c51..1888fba9b9 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -1251,8 +1251,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);
}