summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
authorJulian Taylor <jtaylor.debian@googlemail.com>2014-09-23 20:59:05 +0200
committerJulian Taylor <jtaylor.debian@googlemail.com>2014-09-23 21:30:56 +0200
commite5a7d585286fedec032cf6fbecfca2a44156bbdc (patch)
tree626ea3844ed15040fc9532f37937a7dbccda07cf /numpy/core
parent7be6655c34c2e25232964079818fffe0d7d03696 (diff)
downloadnumpy-e5a7d585286fedec032cf6fbecfca2a44156bbdc.tar.gz
BUG: check success of PyArray_DescrFromType in PyArray_InnerProduct
closes gh-5065
Diffstat (limited to 'numpy/core')
-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 682705a1b..de8f481ae 100644
--- a/numpy/core/src/multiarray/multiarraymodule.c
+++ b/numpy/core/src/multiarray/multiarraymodule.c
@@ -818,6 +818,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);