mirror of
https://github.com/python/cpython.git
synced 2025-07-13 14:25:18 +00:00
Fix a memory leak when initializing the standard I/O streams.
This commit is contained in:
parent
892b0b928d
commit
2fabface50
1 changed files with 2 additions and 1 deletions
|
@ -1012,7 +1012,8 @@ initstdio(void)
|
|||
const char * encoding;
|
||||
encoding = _PyUnicode_AsString(encoding_attr);
|
||||
if (encoding != NULL) {
|
||||
_PyCodec_Lookup(encoding);
|
||||
PyObject *codec_info = _PyCodec_Lookup(encoding);
|
||||
Py_XDECREF(codec_info);
|
||||
}
|
||||
Py_DECREF(encoding_attr);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue