summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2021-07-27 14:47:23 -0700
committerSebastian Berg <sebastian@sipsolutions.net>2021-07-27 14:47:23 -0700
commitc6fdddeddbbe176ada161955094739998ff15272 (patch)
tree073c25dcc5ff4b8e2148e90f6f440b828c253e22 /numpy
parent1f8105a19da4bacb4cf9926e18e96bfc5cdc2c82 (diff)
downloadnumpy-c6fdddeddbbe176ada161955094739998ff15272.tar.gz
BUG: Fix `signature_tuple` refcount in ufunc loop registration
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/umath/ufunc_object.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index c2554bd2e..5a32ae603 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -5560,6 +5560,8 @@ PyUFunc_RegisterLoopForType(PyUFuncObject *ufunc,
goto fail;
}
}
+ /* Clearing sets it to NULL for the error paths */
+ Py_CLEAR(signature_tuple);
funcdata->func = function;
funcdata->arg_types = newtypes;
@@ -5630,7 +5632,6 @@ PyUFunc_RegisterLoopForType(PyUFuncObject *ufunc,
}
}
Py_DECREF(key);
- Py_DECREF(signature_tuple);
return 0;
fail: