summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/core/src/umath/ufunc_object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index 9006a9db6..539806ca9 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -1014,12 +1014,12 @@ ufunc_loop_matches(PyUFuncObject *self,
}
if (!PyArray_CanCastTypeTo(tmp, PyArray_DESCR(op[i]),
output_casting)) {
- Py_DECREF(tmp);
if (!(*out_no_castable_output)) {
*out_no_castable_output = 1;
*out_err_src_typecode = tmp->type;
*out_err_dst_typecode = PyArray_DESCR(op[i])->type;
}
+ Py_DECREF(tmp);
return 0;
}
Py_DECREF(tmp);