Skip to content

Commit 5e9ee06

Browse files
committed
BUG: decref array when falling back to slow call
1 parent c668bb3 commit 5e9ee06

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

bottleneck/src/move_template.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,7 @@ mover(char *name,
915915

916916
/* check for byte swapped input array */
917917
if (PyArray_ISBYTESWAPPED(a)) {
918+
Py_DECREF(a);
918919
return slow(name, args, kwds);
919920
}
920921

bottleneck/src/nonreduce_axis_template.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,7 @@ nonreducer_axis(char *name,
654654

655655
/* check for byte swapped input array */
656656
if (PyArray_ISBYTESWAPPED(a)) {
657+
Py_DECREF(a);
657658
return slow(name, args, kwds);
658659
}
659660

bottleneck/src/nonreduce_template.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ nonreducer(char *name,
223223

224224
/* check for byte swapped input array */
225225
if (PyArray_ISBYTESWAPPED(a)) {
226+
Py_DECREF(a);
226227
return slow(name, args, kwds);
227228
}
228229

bottleneck/src/reduce_template.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,7 @@ reducer(char *name,
11971197

11981198
/* check for byte swapped input array */
11991199
if (PyArray_ISBYTESWAPPED(a)) {
1200+
Py_DECREF(a);
12001201
return slow(name, args, kwds);
12011202
}
12021203

0 commit comments

Comments
 (0)