Commit 85c761d3 authored by Victor Stinner's avatar Victor Stinner

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

bytes is NULL on _PyBytes_Resize() failure
parent 8361617f
...@@ -739,7 +739,7 @@ fileio_read(fileio *self, PyObject *args) ...@@ -739,7 +739,7 @@ fileio_read(fileio *self, PyObject *args)
if (n != size) { if (n != size) {
if (_PyBytes_Resize(&bytes, n) < 0) { if (_PyBytes_Resize(&bytes, n) < 0) {
Py_DECREF(bytes); Py_CLEAR(bytes);
return NULL; return NULL;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment