commit | 8f734ebe94fec52380789a5f1c95a531378db024 | [log] [tgz] |
---|---|---|
author | Christian Heimes <christian@cheimes.de> | Mon Sep 10 17:46:09 2012 +0200 |
committer | Christian Heimes <christian@cheimes.de> | Mon Sep 10 17:46:09 2012 +0200 |
tree | 1418f34d5bfffd367d4aaf4bcef547ec3e004baf | |
parent | fd3023649459c5eac49f401335d43a9587da5e71 [diff] [blame] |
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
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 @@ } chunks = PyList_New(0); - if (chunks == NULL) + if (chunks == NULL) { + Py_XDECREF(data); return NULL; + } while (1) { if (data) {