diff Python/pythonrun.c @ 66318:6eabf8c1a75c

Issue #10255: Fix reference leak in Py_InitializeEx(). Patch by Neil Schemenauer.
author Antoine Pitrou <solipsis@pitrou.net>
date Sat, 20 Nov 2010 19:50:57 +0000
parents 06f76ef27f86
children 724920a015f7
line wrap: on
line diff
--- a/Python/pythonrun.c	Sat Nov 20 19:37:28 2010 +0000
+++ b/Python/pythonrun.c	Sat Nov 20 19:50:57 2010 +0000
@@ -893,8 +893,10 @@
 
     /* Set builtins.open */
     if (PyObject_SetAttrString(bimod, "open", wrapper) == -1) {
+        Py_DECREF(wrapper);
         goto error;
     }
+    Py_DECREF(wrapper);
 
     encoding = Py_GETENV("PYTHONIOENCODING");
     errors = NULL;