summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core')
-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 067de6990..eceb18994 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -5355,6 +5355,7 @@ PyUFunc_RegisterLoopForType(PyUFuncObject *ufunc,
/* Get entry for this user-defined type*/
cobj = PyDict_GetItemWithError(ufunc->userloops, key);
if (cobj == NULL && PyErr_Occurred()) {
+ Py_DECREF(key);
return 0;
}
/* If it's not there, then make one and return. */