Skip to content

Commit

Permalink
BUG: Fix memory leak in mapping.c
Browse files Browse the repository at this point in the history
Fix missing DECREF before successful return.

Closes numpy#12037.
  • Loading branch information
charris committed Oct 9, 2018
1 parent 8a560b9 commit 688314b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion numpy/core/src/multiarray/mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -1128,8 +1128,8 @@ array_boolean_subscript(PyArrayObject *self,
1, &size, PyArray_STRIDES(ret), PyArray_BYTES(ret),
PyArray_FLAGS(self), (PyObject *)self, (PyObject *)tmp);

Py_DECREF(tmp);
if (ret == NULL) {
Py_DECREF(tmp);
return NULL;
}
}
Expand Down

0 comments on commit 688314b

Please sign in to comment.