summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS3
-rw-r--r--Python/pythonrun.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 663b226..43afccd 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@ What's New in Python 3.2 Beta 1?
Core and Builtins
-----------------
+- Issue #10255: Fix reference leak in Py_InitializeEx(). Patch by Neil
+ Schemenauer.
+
- Issue #4925: Add filename to error message when executable can't be found in
subprocess.
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 784558c..37c1f11 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -893,8 +893,10 @@ initstdio(void)
/* Set builtins.open */
if (PyObject_SetAttrString(bimod, "open", wrapper) == -1) {
+ Py_DECREF(wrapper);
goto error;
}
+ Py_DECREF(wrapper);
encoding = Py_GETENV("PYTHONIOENCODING");
errors = NULL;