mirror of
https://github.com/python/cpython.git
synced 2025-07-19 09:15:34 +00:00
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.
This commit is contained in:
parent
d52aa31378
commit
29adc13bd7
1 changed files with 2 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue