diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/src/multiarray/buffer.c | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/ctors.c | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/buffer.c b/numpy/core/src/multiarray/buffer.c index 21dbdefd6..0325f3c6a 100644 --- a/numpy/core/src/multiarray/buffer.c +++ b/numpy/core/src/multiarray/buffer.c @@ -468,6 +468,7 @@ _buffer_info_new(PyObject *obj) info = malloc(sizeof(_buffer_info_t)); if (info == NULL) { + PyErr_NoMemory(); goto fail; } @@ -493,6 +494,7 @@ _buffer_info_new(PyObject *obj) else { info->shape = malloc(sizeof(Py_ssize_t) * PyArray_NDIM(arr) * 2 + 1); if (info->shape == NULL) { + PyErr_NoMemory(); goto fail; } info->strides = info->shape + PyArray_NDIM(arr); diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c index 938850997..a2cf17f4e 100644 --- a/numpy/core/src/multiarray/ctors.c +++ b/numpy/core/src/multiarray/ctors.c @@ -92,6 +92,7 @@ swab_separator(const char *sep) s = start = malloc(strlen(sep)+3); if (s == NULL) { + PyErr_NoMemory(); return NULL; } /* add space to front if there isn't one */ |