diff options
| author | Sebastian Berg <sebastian@sipsolutions.net> | 2021-07-27 14:47:23 -0700 |
|---|---|---|
| committer | Sebastian Berg <sebastian@sipsolutions.net> | 2021-07-27 14:47:23 -0700 |
| commit | c6fdddeddbbe176ada161955094739998ff15272 (patch) | |
| tree | 073c25dcc5ff4b8e2148e90f6f440b828c253e22 /numpy | |
| parent | 1f8105a19da4bacb4cf9926e18e96bfc5cdc2c82 (diff) | |
| download | numpy-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.c | 3 |
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: |
