summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Defois <hugo.defois@symphonyretailai.com>2021-07-07 23:53:05 +0200
committerSebastian Berg <sebastian@sipsolutions.net>2021-09-29 14:03:11 -0500
commitd594768ade744d9b5baf46d270dbb83259c906f2 (patch)
tree397b2cc65c7d697994360c58bc0bd208eeeb939c
parent54959ec46bc53822e119da06809306540cf6a0e5 (diff)
downloadnumpy-d594768ade744d9b5baf46d270dbb83259c906f2.tar.gz
BUG: fix a PyArray_DiscoverDTypeAndShape_Recursive leak
-rw-r--r--numpy/core/src/multiarray/array_coercion.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/array_coercion.c b/numpy/core/src/multiarray/array_coercion.c
index 847bdafc3..8e5183424 100644
--- a/numpy/core/src/multiarray/array_coercion.c
+++ b/numpy/core/src/multiarray/array_coercion.c
@@ -1089,6 +1089,7 @@ PyArray_DiscoverDTypeAndShape_Recursive(
}
/* The cache takes ownership of the sequence here. */
if (npy_new_coercion_cache(obj, seq, 1, coercion_cache_tail_ptr, curr_dims) < 0) {
+ Py_DECREF(seq);
return -1;
}