diff options
author | Barry Warsaw <barry@python.org> | 2011-09-20 14:58:01 -0400 |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2011-09-20 14:58:01 -0400 |
commit | 57c78077fcbd997a62f6ce408b74e724d4cc6ded (patch) | |
tree | a6081966226d972bd6f18258cf27782167dfc3b9 /Python | |
parent | aa253acaa212426f38c64ac2a1c7f06c75f70781 (diff) | |
parent | 98292273d840a24a366ab585f907da593c0726e0 (diff) | |
download | cpython-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')
-rw-r--r-- | Python/pythonrun.c | 4 |
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); } |