From 74647b34dbf83929a3e66bddfc376c4a53705689 Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Sat, 13 Jun 2020 15:10:45 -0500 Subject: BUG: Fix reference count leak in mapping.c This is an oversight by me. It only leaks references, so it is harmless, but it will show up as a leak when doing a leak check. --- numpy/core/src/multiarray/mapping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/numpy/core/src/multiarray/mapping.c b/numpy/core/src/multiarray/mapping.c index 7aefbfc38..f73cb48d9 100644 --- a/numpy/core/src/multiarray/mapping.c +++ b/numpy/core/src/multiarray/mapping.c @@ -2480,8 +2480,6 @@ PyArray_MapIterCheckIndices(PyArrayMapIterObject *mit) int i; NPY_BEGIN_THREADS_DEF; - intp_type = PyArray_DescrFromType(NPY_INTP); - if (NpyIter_GetIterSize(mit->outer) == 0) { /* * When the outer iteration is empty, the indices broadcast to an @@ -2493,6 +2491,8 @@ PyArray_MapIterCheckIndices(PyArrayMapIterObject *mit) return 0; } + intp_type = PyArray_DescrFromType(NPY_INTP); + NPY_BEGIN_THREADS; for (i=0; i < mit->numiter; i++) { -- cgit v1.2.1