Browse Source

Issue #18408: Fix fileio_read() on _PyBytes_Resize() failure

bytes is NULL on _PyBytes_Resize() failure
pull/224/head
Victor Stinner 13 years ago
parent
commit
85c761d3d3
  1. 2
      Modules/_io/fileio.c

2
Modules/_io/fileio.c

@ -739,7 +739,7 @@ fileio_read(fileio *self, PyObject *args)
if (n != size) {
if (_PyBytes_Resize(&bytes, n) < 0) {
Py_DECREF(bytes);
Py_CLEAR(bytes);
return NULL;
}
}

Loading…
Cancel
Save