diff options
author | Barry Warsaw <barry@python.org> | 2011-09-20 14:45:44 -0400 |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2011-09-20 14:45:44 -0400 |
commit | 98292273d840a24a366ab585f907da593c0726e0 (patch) | |
tree | ccdc91502ebf5559f2a99d5b5d2d8e69933245f5 /Python/pythonrun.c | |
parent | 81876821244ec036452533279d4cd2908a302e4f (diff) | |
download | cpython-98292273d840a24a366ab585f907da593c0726e0.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.c | 4 |
1 files changed, 3 insertions, 1 deletions
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); } |