summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2008-06-02 12:33:47 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2008-06-02 12:33:47 (GMT)
commit7cd068baab4f21bb252ca7e528f57a8eaffa7738 (patch)
treedd81c6161d4d511e72e4e19b758d6facfdc87a3f /Python
parent704d8b154b23dfc2fdf5a378e31636ba1a6e2d22 (diff)
downloadcpython-7cd068baab4f21bb252ca7e528f57a8eaffa7738.zip
cpython-7cd068baab4f21bb252ca7e528f57a8eaffa7738.tar.gz
cpython-7cd068baab4f21bb252ca7e528f57a8eaffa7738.tar.bz2
Fix uninitialized variable access, release memory.
Diffstat (limited to 'Python')
-rw-r--r--Python/pythonrun.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index f2f14ed..7fe4cce 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;