summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Pitrou <antoine@python.org>2015-02-23 19:43:05 +0100
committerJulian Taylor <jtaylor.debian@googlemail.com>2015-02-23 20:11:33 +0100
commit50afb0fb67b4b9d1bffa3baf4b87332040c54a70 (patch)
tree7e14355ab58081d6f6da42363452b4c038bd7647
parentc3888e73fff4731018e3733a9d1d66441b2a8146 (diff)
downloadnumpy-50afb0fb67b4b9d1bffa3baf4b87332040c54a70.tar.gz
BUG: Fix a reference leak in ufunc type resolution.
ensure_dtype_nbo() already creates a new reference.
-rw-r--r--numpy/core/src/umath/ufunc_type_resolution.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/numpy/core/src/umath/ufunc_type_resolution.c b/numpy/core/src/umath/ufunc_type_resolution.c
index ffdb15bbe..6ef4438b4 100644
--- a/numpy/core/src/umath/ufunc_type_resolution.c
+++ b/numpy/core/src/umath/ufunc_type_resolution.c
@@ -1594,7 +1594,6 @@ set_ufunc_loop_data_types(PyUFuncObject *self, PyArrayObject **op,
else if (op[i] != NULL &&
PyArray_DESCR(op[i])->type_num == type_nums[i]) {
out_dtypes[i] = ensure_dtype_nbo(PyArray_DESCR(op[i]));
- Py_XINCREF(out_dtypes[i]);
}
/*
* For outputs, copy the dtype from op[0] if the type_num
@@ -1603,7 +1602,6 @@ set_ufunc_loop_data_types(PyUFuncObject *self, PyArrayObject **op,
else if (i >= nin && op[0] != NULL &&
PyArray_DESCR(op[0])->type_num == type_nums[i]) {
out_dtypes[i] = ensure_dtype_nbo(PyArray_DESCR(op[0]));
- Py_XINCREF(out_dtypes[i]);
}
/* Otherwise create a plain descr from the type number */
else {