summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorstratakis <cstratak@redhat.com>2019-03-14 15:35:40 (GMT)
committerVictor Stinner <vstinner@redhat.com>2019-03-14 15:35:40 (GMT)
commit2dd6e079ae71f3723fbea2582ac080be06a6968f (patch)
tree036994b21559ddd8a504d412b91a440860b422b0 /Modules
parentfb3336acfde3204fd01ce519ef24cc18a94dfa3f (diff)
downloadcpython-2dd6e079ae71f3723fbea2582ac080be06a6968f.zip
cpython-2dd6e079ae71f3723fbea2582ac080be06a6968f.tar.gz
cpython-2dd6e079ae71f3723fbea2582ac080be06a6968f.tar.bz2
[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.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_io/bufferedio.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c
index b8c98a4..d68f7d8 100644
--- a/Modules/_io/bufferedio.c
+++ b/Modules/_io/bufferedio.c
@@ -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);