Issue #18408: Fix fileio_read() on _PyBytes_Resize() failure
bytes is NULL on _PyBytes_Resize() failure
This commit is contained in:
parent
8361617fad
commit
85c761d3d3
|
@ -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…
Reference in New Issue