]> granicus.if.org Git - python/commitdiff
Issue #10255: Fix reference leak in Py_InitializeEx(). Patch by Neil
authorAntoine Pitrou <solipsis@pitrou.net>
Sat, 20 Nov 2010 19:50:57 +0000 (19:50 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Sat, 20 Nov 2010 19:50:57 +0000 (19:50 +0000)
Schemenauer.

Misc/NEWS
Python/pythonrun.c

index 663b226d761bed586599009a488f0bfcb429d510..43afccd64284ae16333e3d3486b725e5e5e15048 100644 (file)
--- 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.
 
index 784558c11976a96d910f4073aeba03604821551d..37c1f1197aa746e540d5db30b552746ce001c064 100644 (file)
@@ -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;