[2.7] bpo-36289: Fix a possible reference leak in the io module (GH-12329)
Fix a reference leak in _bufferedreader_read_all(): _io.BufferedIOMixin.read() leaks a reference on 'data' when it reads the whole file content but flush() fails.
This commit is contained in:
parent
fb3336acfd
commit
2dd6e079ae
|
@ -0,0 +1 @@
|
|||
Fix a possible reference leak in the io module.
|
|
@ -1363,6 +1363,7 @@ _bufferedreader_read_all(buffered *self)
|
|||
res = buffered_flush_and_rewind_unlocked(self);
|
||||
if (res == NULL) {
|
||||
Py_DECREF(chunks);
|
||||
Py_XDECREF(data);
|
||||
return NULL;
|
||||
}
|
||||
Py_CLEAR(res);
|
||||
|
|
Loading…
Reference in New Issue