From 7cd068baab4f21bb252ca7e528f57a8eaffa7738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Mon, 2 Jun 2008 12:33:47 +0000 Subject: Fix uninitialized variable access, release memory. --- Python/pythonrun.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Python/pythonrun.c') diff --git a/Python/pythonrun.c b/Python/pythonrun.c index f2f14edb99..7fe4ccea55 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -732,6 +732,7 @@ initstdio(void) } encoding = Py_GETENV("PYTHONIOENCODING"); + errors = NULL; if (encoding) { encoding = strdup(encoding); errors = strchr(encoding, ':'); @@ -825,6 +826,8 @@ initstdio(void) status = -1; } + if (encoding) + free(encoding); Py_XDECREF(bimod); Py_XDECREF(iomod); return status; -- cgit v1.2.1