Commit e9ee44c2 authored by Neal Norwitz's avatar Neal Norwitz

Check for memory alloc failure

parent a4dd2e20
...@@ -1849,6 +1849,8 @@ buffer_info(PyObject *self, PyObject *arg) ...@@ -1849,6 +1849,8 @@ buffer_info(PyObject *self, PyObject *arg)
return NULL; return NULL;
} }
shape = PyTuple_New(dict->ndim); shape = PyTuple_New(dict->ndim);
if (shape == NULL)
return NULL;
for (i = 0; i < (int)dict->ndim; ++i) for (i = 0; i < (int)dict->ndim; ++i)
PyTuple_SET_ITEM(shape, i, PyLong_FromSsize_t(dict->shape[i])); PyTuple_SET_ITEM(shape, i, PyLong_FromSsize_t(dict->shape[i]));
......
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