diff options
author | Julian Taylor <jtaylor.debian@googlemail.com> | 2013-11-06 20:34:05 +0100 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2013-11-06 21:25:32 +0100 |
commit | a0568165ecc19a60eb47e1b936a0c7c0a1e83501 (patch) | |
tree | efbde76b9755ccc491263464ae5ffb4b5737294d /numpy | |
parent | e7e365fa6c3fff01fcb833664425f9b468f2aefd (diff) | |
download | numpy-a0568165ecc19a60eb47e1b936a0c7c0a1e83501.tar.gz |
BUG: fix missing check for memory allocation failure in ufuncs
closes gh-4018
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/src/umath/ufunc_object.c | 6 |
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 9b4f90a0e..6c18f51bf 100644 --- a/numpy/core/src/umath/ufunc_object.c +++ b/numpy/core/src/umath/ufunc_object.c @@ -1436,6 +1436,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], @@ -1488,6 +1491,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], |