Kaydet (Commit) 2fabface authored tarafından Antoine Pitrou's avatar Antoine Pitrou

Fix a memory leak when initializing the standard I/O streams.

üst 892b0b92
...@@ -1012,7 +1012,8 @@ initstdio(void) ...@@ -1012,7 +1012,8 @@ initstdio(void)
const char * encoding; const char * encoding;
encoding = _PyUnicode_AsString(encoding_attr); encoding = _PyUnicode_AsString(encoding_attr);
if (encoding != NULL) { if (encoding != NULL) {
_PyCodec_Lookup(encoding); PyObject *codec_info = _PyCodec_Lookup(encoding);
Py_XDECREF(codec_info);
} }
Py_DECREF(encoding_attr); Py_DECREF(encoding_attr);
} }
......
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