summaryrefslogtreecommitdiffstats
path: root/Modules/_io
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2012-09-10 15:46:09 (GMT)
committerChristian Heimes <christian@cheimes.de>2012-09-10 15:46:09 (GMT)
commit8f734ebe94fec52380789a5f1c95a531378db024 (patch)
tree1418f34d5bfffd367d4aaf4bcef547ec3e004baf /Modules/_io
parentfd3023649459c5eac49f401335d43a9587da5e71 (diff)
downloadcpython-8f734ebe94fec52380789a5f1c95a531378db024.zip
cpython-8f734ebe94fec52380789a5f1c95a531378db024.tar.gz
cpython-8f734ebe94fec52380789a5f1c95a531378db024.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.c4
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) {