mirror of https://github.com/python/cpython.git
Fixed reference leak in error branch of _bufferedreader_read_all(). The variable data can contain a bytes object but it wasn't cleaned up when PyList_New() failed. CID 715364
This commit is contained in:
parent
76c082911b
commit
f47d79fec1
|
@ -1499,8 +1499,10 @@ _bufferedreader_read_all(buffered *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
chunks = PyList_New(0);
|
chunks = PyList_New(0);
|
||||||
if (chunks == NULL)
|
if (chunks == NULL) {
|
||||||
|
Py_XDECREF(data);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
if (data) {
|
if (data) {
|
||||||
|
|
Loading…
Reference in New Issue