]> granicus.if.org Git - python/commitdiff
Fixed reference leak in error branch of _bufferedreader_read_all(). The variable...
authorChristian Heimes <christian@cheimes.de>
Mon, 10 Sep 2012 15:46:09 +0000 (17:46 +0200)
committerChristian Heimes <christian@cheimes.de>
Mon, 10 Sep 2012 15:46:09 +0000 (17:46 +0200)
Modules/_io/bufferedio.c

index 67b7cc4501a4aad90905d822700779c12610b9cc..334734beccbae8d3d4271eaeb973c46460a620cd 100644 (file)
@@ -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) {