diff options
author | Christian Heimes <christian@cheimes.de> | 2012-09-10 15:46:09 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2012-09-10 15:46:09 (GMT) |
commit | f47d79fec1b6cbb0d38b9a828cf94202c21e50f8 (patch) | |
tree | 47e3e0b91358bc409df40189eeeb27fa768b531c /Modules/_io | |
parent | 76c082911b69c5f3bb2bee9aadef0a0ea9162eac (diff) | |
download | cpython-f47d79fec1b6cbb0d38b9a828cf94202c21e50f8.zip cpython-f47d79fec1b6cbb0d38b9a828cf94202c21e50f8.tar.gz cpython-f47d79fec1b6cbb0d38b9a828cf94202c21e50f8.tar.bz2 |
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
Diffstat (limited to 'Modules/_io')
-rw-r--r-- | Modules/_io/bufferedio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index 67b7cc4..334734b 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -1499,8 +1499,10 @@ _bufferedreader_read_all(buffered *self) } chunks = PyList_New(0); - if (chunks == NULL) + if (chunks == NULL) { + Py_XDECREF(data); return NULL; + } while (1) { if (data) { |