1. python_mirrors
  2. cpython

Commits

Christian Heimes  committed b7c6dd1 Draft

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

  • Participants
  • Parent commits d000fb7
  • Branches default

Comments (0)

Files changed (1)

File Modules/_io/bufferedio.c

View file
  • Ignore whitespace
     }
 
     chunks = PyList_New(0);
-    if (chunks == NULL)
+    if (chunks == NULL) {
+        Py_XDECREF(data);
         return NULL;
+    }
 
     while (1) {
         if (data) {