mirror of https://github.com/python/cpython
Check for memory alloc failure
This commit is contained in:
parent
a4dd2e20e2
commit
e9ee44c25b
|
@ -1849,6 +1849,8 @@ buffer_info(PyObject *self, PyObject *arg)
|
|||
return NULL;
|
||||
}
|
||||
shape = PyTuple_New(dict->ndim);
|
||||
if (shape == NULL)
|
||||
return NULL;
|
||||
for (i = 0; i < (int)dict->ndim; ++i)
|
||||
PyTuple_SET_ITEM(shape, i, PyLong_FromSsize_t(dict->shape[i]));
|
||||
|
||||
|
|
Loading…
Reference in New Issue