diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2008-06-02 12:33:47 +0000 |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2008-06-02 12:33:47 +0000 |
commit | e473c16a2e64f83c6339fec87aea6af1fd907b36 (patch) | |
tree | 21289fc530e878711c45c36fd352b125b335e458 /Python/pythonrun.c | |
parent | 22c922dc118c08a3b2e1f0ea94419ac875da3f7d (diff) | |
download | cpython-e473c16a2e64f83c6339fec87aea6af1fd907b36.tar.gz |
Fix uninitialized variable access, release memory.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; |