summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2014-09-23 15:20:00 -0600
committerCharles Harris <charlesr.harris@gmail.com>2014-09-23 15:20:00 -0600
commit27d73bf3295df59bd0e2d31605b0cbfc2a69f12d (patch)
tree200b1e8c054eaed0990600215e4e81231c5e3bd7
parentd7fd1e8d8b97db7efbb9c1ff02e96fb9948bfb1a (diff)
parente5a7d585286fedec032cf6fbecfca2a44156bbdc (diff)
downloadnumpy-27d73bf3295df59bd0e2d31605b0cbfc2a69f12d.tar.gz
Merge pull request #5104 from juliantaylor/inner-fix
BUG: check success of PyArray_DescrFromType in PyArray_InnerProduct
-rw-r--r--numpy/core/src/multiarray/multiarraymodule.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/multiarraymodule.c b/numpy/core/src/multiarray/multiarraymodule.c
index f54b0e4df..55ae16515 100644
--- a/numpy/core/src/multiarray/multiarraymodule.c
+++ b/numpy/core/src/multiarray/multiarraymodule.c
@@ -831,6 +831,9 @@ PyArray_InnerProduct(PyObject *op1, PyObject *op2)
typenum = PyArray_ObjectType(op2, typenum);
typec = PyArray_DescrFromType(typenum);
+ if (typec == NULL) {
+ return NULL;
+ }
Py_INCREF(typec);
ap1 = (PyArrayObject *)PyArray_FromAny(op1, typec, 0, 0,
NPY_ARRAY_ALIGNED, NULL);