summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortheoniko <nikolaoutheod@gmail.com>2021-07-03 17:25:00 +0200
committertheoniko <theoniko@github.com>2021-07-08 07:29:30 +0200
commit90047830d5d30dd64bf911c1eaf825c7553b1ade (patch)
treee103744791c2cea2af5488c9ca0d47100085cdb4
parentf128be6c671d320c84771e923ddaf6467645216f (diff)
downloadnumpy-90047830d5d30dd64bf911c1eaf825c7553b1ade.tar.gz
BUG: Fix memory leak in function npyiter_multi_index_set
-rw-r--r--numpy/core/src/multiarray/number.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/number.c b/numpy/core/src/multiarray/number.c
index a62776748..9ed7cde47 100644
--- a/numpy/core/src/multiarray/number.c
+++ b/numpy/core/src/multiarray/number.c
@@ -429,6 +429,7 @@ is_scalar_with_conversion(PyObject *o2, double* out_exponent)
return NPY_NOSCALAR;
}
val = PyLong_AsSsize_t(value);
+ Py_DECREF(value);
if (error_converting(val)) {
PyErr_Clear();
return NPY_NOSCALAR;