summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2021-06-21 10:14:33 -0500
committerSebastian Berg <sebastian@sipsolutions.net>2021-06-21 10:14:44 -0500
commit548b8c72d66bb279d7c6dea9c2ff67e7ec21c7da (patch)
treeabbc4e5532a31cf9edd22f46fd8ae6a75dc7a72f
parent31e232c47e6be5ddc1c2433ccb97cec1640df012 (diff)
downloadnumpy-548b8c72d66bb279d7c6dea9c2ff67e7ec21c7da.tar.gz
BUG: Fix reference count leak
This adds a missing decref to the signature/dtype keyword argument logic in reductions. (The code will change quite a bit after 1.21, but this avoids a reference count leak on 1.21.)
-rw-r--r--numpy/core/src/umath/ufunc_object.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index 37e297ed5..e99d2614a 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -4054,6 +4054,7 @@ PyUFunc_GenericReduction(PyUFuncObject *ufunc,
}
Py_INCREF(dtype->singleton);
otype = dtype->singleton;
+ Py_DECREF(dtype);
}
if (out_obj && !PyArray_OutputConverter(out_obj, &out)) {
goto fail;