Skip to content

Commit

Permalink
Merge pull request #26190 from ngoldbaum/fix-refcnt-error
Browse files Browse the repository at this point in the history
BUG: fix reference counting error in wrapping_method_resolve_descriptors
  • Loading branch information
charris committed Apr 1, 2024
2 parents 1c8b03b + 3849c4b commit 3c9141b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions numpy/_core/src/umath/wrapping_array_method.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ wrapping_method_resolve_descriptors(
self->wrapped_meth, self->wrapped_dtypes,
orig_given_descrs, orig_loop_descrs, view_offset);
for (int i = 0; i < nargs; i++) {
Py_XDECREF(orig_given_descrs);
Py_XDECREF(orig_given_descrs[i]);
}
if (casting < 0) {
return -1;
}
int res = self->translate_loop_descrs(
nin, nout, dtypes, given_descrs, orig_loop_descrs, loop_descrs);
for (int i = 0; i < nargs; i++) {
Py_DECREF(orig_given_descrs);
Py_DECREF(orig_loop_descrs[i]);
}
if (res < 0) {
return -1;
Expand Down

0 comments on commit 3c9141b

Please sign in to comment.