summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/core/src/umath/ufunc_object.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index 866ec642a..906b8214c 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -1437,6 +1437,9 @@ execute_legacy_ufunc_loop(PyUFuncObject *ufunc,
PyArray_ISFORTRAN(op[0]) ?
NPY_ARRAY_F_CONTIGUOUS : 0,
NULL);
+ if (op[1] == NULL) {
+ return -1;
+ }
/* Call the __prepare_array__ if necessary */
if (prepare_ufunc_output(ufunc, &op[1],
@@ -1489,6 +1492,9 @@ execute_legacy_ufunc_loop(PyUFuncObject *ufunc,
PyArray_ISFORTRAN(tmp) ?
NPY_ARRAY_F_CONTIGUOUS : 0,
NULL);
+ if (op[2] == NULL) {
+ return -1;
+ }
/* Call the __prepare_array__ if necessary */
if (prepare_ufunc_output(ufunc, &op[2],