summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--Misc/NEWS3
-rw-r--r--Python/pythonrun.c4
2 files changed, 6 insertions, 1 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 72e1a0c..567e492 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@ What's New in Python 3.3 Alpha 1?
Core and Builtins
-----------------
+- Issue #13021: Missing decref on an error path. Thanks to Suman Saha for
+ finding the bug and providing a patch.
+
- Issue #12973: Fix overflow check that relied on undefined behaviour in
list_repeat. This bug caused test_list to fail with recent versions
of Clang.
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);
}