Skip to content

Commit b1cd15a

Browse files
Merge pull request #533 from neutrinoceros/bug/520-leak
2 parents c98de4a + 7f72dd6 commit b1cd15a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bottleneck/src/nonreduce_axis_template.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ NRA(partition, DTYPE0) {
6161
PyErr_Format(PyExc_ValueError,
6262
"`n` (=%d) must be between 0 and %zd, inclusive.",
6363
n, LENGTH - 1);
64+
Py_DECREF(a);
6465
return NULL;
6566
}
6667

@@ -172,6 +173,7 @@ NRA(argpartition, DTYPE0) {
172173
PyErr_Format(PyExc_ValueError,
173174
"`n` (=%d) must be between 0 and %zd, inclusive.",
174175
n, LENGTH - 1);
176+
Py_DECREF(y);
175177
return NULL;
176178
}
177179
BN_BEGIN_ALLOW_THREADS

0 commit comments

Comments
 (0)