Kaydet (Commit) 7cd068ba authored tarafından Martin v. Löwis's avatar Martin v. Löwis

Fix uninitialized variable access, release memory.

üst 704d8b15
...@@ -732,6 +732,7 @@ initstdio(void) ...@@ -732,6 +732,7 @@ initstdio(void)
} }
encoding = Py_GETENV("PYTHONIOENCODING"); encoding = Py_GETENV("PYTHONIOENCODING");
errors = NULL;
if (encoding) { if (encoding) {
encoding = strdup(encoding); encoding = strdup(encoding);
errors = strchr(encoding, ':'); errors = strchr(encoding, ':');
...@@ -825,6 +826,8 @@ initstdio(void) ...@@ -825,6 +826,8 @@ initstdio(void)
status = -1; status = -1;
} }
if (encoding)
free(encoding);
Py_XDECREF(bimod); Py_XDECREF(bimod);
Py_XDECREF(iomod); Py_XDECREF(iomod);
return status; return status;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment