summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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) {