summaryrefslogtreecommitdiff
path: root/Modules/_io
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2012-09-10 17:46:09 +0200
committerChristian Heimes <christian@cheimes.de>2012-09-10 17:46:09 +0200
commitac5426147e21ad3d84d34ebbb27955ba285d279a (patch)
treec2a4461d9594d03ea265f6ba8b9bc6aa0c2bbad5 /Modules/_io
parent4af2093ee5ad78424e6b4f541a381ad7d4b66f98 (diff)
downloadcpython-ac5426147e21ad3d84d34ebbb27955ba285d279a.tar.gz
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 67b7cc4501..334734becc 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) {