diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2021-06-21 10:14:33 -0500 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2021-06-21 10:14:44 -0500 |
commit | 548b8c72d66bb279d7c6dea9c2ff67e7ec21c7da (patch) | |
tree | abbc4e5532a31cf9edd22f46fd8ae6a75dc7a72f | |
parent | 31e232c47e6be5ddc1c2433ccb97cec1640df012 (diff) | |
download | numpy-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.c | 1 |
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; |