From 75596c7d735b7520f34bb96e70effcb6b0d1cb24 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Sat, 20 Nov 2010 19:50:57 +0000 Subject: Issue #10255: Fix reference leak in Py_InitializeEx(). Patch by Neil Schemenauer. --- Python/pythonrun.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Python/pythonrun.c') diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 784558c119..37c1f1197a 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; -- cgit v1.2.1