8000 Merge pull request #5104 from juliantaylor/inner-fix · numpy/numpy@38ed773 · GitHub
[go: up one dir, main page]

Skip to content

Commit 38ed773

Browse files
committed
Merge pull request #5104 from juliantaylor/inner-fix
BUG: check success of PyArray_DescrFromType in PyArray_InnerProduct
2 parents 7c3ec61 + e5a7d58 commit 38ed773

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

numpy/core/src/multiarray/multiarraymodule.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,9 @@ PyArray_InnerProduct(PyObject *op1, PyObject *op2)
824824
typenum = PyArray_ObjectType(op2, typenum);
825825

826826
typec = PyArray_DescrFromType(typenum);
827+
if (typec == NULL) {
828+
return NULL;
829+
}
827830
Py_INCREF(typec);
828831
ap1 = (PyArrayObject *)PyArray_FromAny(op1, typec, 0, 0,
829832
NPY_ARRAY_ALIGNED, NULL);

0 commit comments

Comments
 (0)
0