Commit 29adc13b authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

bpo-30601: Fix a refleak in WindowsConsoleIO (#2003)

Fix a reference leak in _io._WindowsConsoleIO: PyUnicode_FSDecoder()
always initialize decodedname when it succeed and it doesn't clear
input decodedname object.
parent d52aa313
......@@ -298,8 +298,7 @@ _io__WindowsConsoleIO___init___impl(winconsoleio *self, PyObject *nameobj,
self->fd = fd;
if (fd < 0) {
PyObject *decodedname = Py_None;
Py_INCREF(decodedname);
PyObject *decodedname;
int d = PyUnicode_FSDecoder(nameobj, (void*)&decodedname);
if (!d)
......
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