summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorJay Bourque <jay.bourque@continuum.io>2013-05-10 15:41:04 -0500
committerJay Bourque <jay.bourque@continuum.io>2013-05-14 18:02:22 -0500
commit84fa1845878c070f190f15e37507bb7575c39d06 (patch)
treee59c79bac191cb6185926b049327440bc00435c5 /numpy
parent59048190120cbced237453ace109d876d0814cee (diff)
downloadnumpy-84fa1845878c070f190f15e37507bb7575c39d06.tar.gz
Add null check
Diffstat (limited to 'numpy')
-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;