summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2011-09-20 18:58:01 (GMT)
committerBarry Warsaw <barry@python.org>2011-09-20 18:58:01 (GMT)
commita80b14cc5f831308df25d1ed3f4e1a1a41d22c58 (patch)
tree6e5e95b493be0c3310174a945e31df2aa48b61d2 /Python/pythonrun.c
parent225aa4f8ec1d98a244f863ee5257a750926a494e (diff)
parent916048d7807b179cbf839346768516bfdaeadecf (diff)
downloadcpython-a80b14cc5f831308df25d1ed3f4e1a1a41d22c58.zip
cpython-a80b14cc5f831308df25d1ed3f4e1a1a41d22c58.tar.gz
cpython-a80b14cc5f831308df25d1ed3f4e1a1a41d22c58.tar.bz2
- 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 5649e86..1888fba 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);
}