Skip to content

Commit fa5754e

Browse files
sebergcharris
authored andcommitted
BUG: Add missing DECREF in new path
Pretty, harmless reference count leak (the method is a singleton)
1 parent 61127bb commit fa5754e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

numpy/core/src/multiarray/convert_datatype.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ PyArray_CheckCastSafety(NPY_CASTING casting,
476476

477477
if (PyArray_MinCastSafety(castingimpl->casting, casting) == casting) {
478478
/* No need to check using `castingimpl.resolve_descriptors()` */
479+
Py_DECREF(meth);
479480
return 1;
480481
}
481482

0 commit comments

Comments
 (0)