summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/src/umath/ufunc_object.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index d844923d4..d0c84d6f5 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -4459,6 +4459,10 @@ PyUFunc_RegisterLoopForStructType(PyUFuncObject *ufunc,
}
arg_typenums = PyArray_malloc(ufunc->nargs * sizeof(int));
+ if (arg_typenums == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
if (arg_dtypes != NULL) {
for (i = 0; i < ufunc->nargs; i++) {
arg_typenums[i] = arg_dtypes[i]->type_num;