summaryrefslogtreecommitdiffstats
path: root/Modules/_io
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-07-16 19:36:02 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-07-16 19:36:02 (GMT)
commit85c761d3d3357615da15b332df36b307c70e2acb (patch)
tree9fa79e8ad9c0eb75c8e8450022ca2a4eff874064 /Modules/_io
parent8361617fada4d496454216beb3578f1e83c5b64d (diff)
downloadcpython-85c761d3d3357615da15b332df36b307c70e2acb.zip
cpython-85c761d3d3357615da15b332df36b307c70e2acb.tar.gz
cpython-85c761d3d3357615da15b332df36b307c70e2acb.tar.bz2
Issue #18408: Fix fileio_read() on _PyBytes_Resize() failure
bytes is NULL on _PyBytes_Resize() failure
Diffstat (limited to 'Modules/_io')
-rw-r--r--Modules/_io/fileio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
index efcc594..5280991 100644
--- a/Modules/_io/fileio.c
+++ b/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;
}
}