summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/core/src/multiarray/mapping.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/core/src/multiarray/mapping.c b/numpy/core/src/multiarray/mapping.c
index cb5c3823d..d64962f87 100644
--- a/numpy/core/src/multiarray/mapping.c
+++ b/numpy/core/src/multiarray/mapping.c
@@ -3194,9 +3194,10 @@ PyArray_MapIterNew(npy_index_info *indices , int index_num, int index_type,
}
PyObject *shape2 = convert_shape_to_string(mit->nd, mit->dimensions, "");
- if (shape2 == NULL)
+ if (shape2 == NULL) {
Py_DECREF(shape1);
goto finish;
+ }
PyErr_Format(PyExc_ValueError,
"shape mismatch: value array of shape %S could not be broadcast "