summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2011-09-20 18:45:44 (GMT)
committerBarry Warsaw <barry@python.org>2011-09-20 18:45:44 (GMT)
commit916048d7807b179cbf839346768516bfdaeadecf (patch)
tree6d9882d5856399fac76cbbffc5cf4766c54625a8
parentc0420fd42ade6d996bfe2ae2beffa3de79524883 (diff)
downloadcpython-916048d7807b179cbf839346768516bfdaeadecf.zip
cpython-916048d7807b179cbf839346768516bfdaeadecf.tar.gz
cpython-916048d7807b179cbf839346768516bfdaeadecf.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 bc52aa8..1d03385 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@ What's New in Python 3.2.3?
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 084db12..bea7fe1 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);
}