summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
authorHugo Defois <hugo.defois@symphonyretailai.com>2021-07-05 16:18:34 +0200
committerHugo Defois <hugo.defois@symphonyretailai.com>2021-07-05 16:18:34 +0200
commit0272316aa55bef9da9d21a8ad590432385bc81e3 (patch)
treeddd1563c6aa112cb30718640bcf0c2da81d1dfd0 /numpy/core
parenta11945d7dc930afe47e1cf7f81cb69f2958f4c1f (diff)
downloadnumpy-0272316aa55bef9da9d21a8ad590432385bc81e3.tar.gz
BUG: fix a leak in ufunc_object.PyUFunc_RegisterLoopForType
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. */