8000 BUG: check success of PyArray_DescrFromType in PyArray_InnerProduct · numpy/numpy@e5a7d58 · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit e5a7d58

Browse files
committed
BUG: check success of PyArray_DescrFromType in PyArray_InnerProduct
closes gh-5065
1 parent 7be6655 commit e5a7d58

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
@@ -818,6 +818,9 @@ PyArray_InnerProduct(PyObject *op1, PyObject *op2)
818818
typenum = PyArray_ObjectType(op2, typenum);
819819

820820
typec = PyArray_DescrFromType(typenum);
821+
if (typec == NULL) {
822+
return NULL;
823+
}
821824
Py_INCREF(typec);
822825
ap1 = (PyArrayObject *)PyArray_FromAny(op1, typec, 0, 0,
823826
NPY_ARRAY_ALIGNED, NULL);

0 commit comments

Comments
 (0)
0