Mercurial > cpython-lru_cache-weakref
diff Python/pythonrun.c @ 47446:b6b534b828b3
Fix uninitialized variable access, release memory.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Mon, 02 Jun 2008 12:33:47 +0000 |
| parents | bb2c4bdc3c68 |
| children | 2284fa89ab08 |
line wrap: on
line diff
--- a/Python/pythonrun.c Mon Jun 02 11:32:23 2008 +0000 +++ b/Python/pythonrun.c Mon Jun 02 12:33:47 2008 +0000 @@ -732,6 +732,7 @@ } encoding = Py_GETENV("PYTHONIOENCODING"); + errors = NULL; if (encoding) { encoding = strdup(encoding); errors = strchr(encoding, ':'); @@ -825,6 +826,8 @@ status = -1; } + if (encoding) + free(encoding); Py_XDECREF(bimod); Py_XDECREF(iomod); return status;
