diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2020-04-15 12:31:11 +0100 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2020-04-15 14:55:10 +0100 |
commit | d6ad8f3b38e2a89a081df0eaf975c28197825d3c (patch) | |
tree | d2e0ca4eea4cba81292880f8135b7d73eb3a962d | |
parent | 6e3df98c15e7fe930e6bdbd3ef9d06881fe0a484 (diff) | |
download | numpy-d6ad8f3b38e2a89a081df0eaf975c28197825d3c.tar.gz |
BUG: Fix double Py_DECREF
`PyArray_SetWritebackIfCopyBase` steals a reference to base, even if it fails.
-rw-r--r-- | numpy/core/src/umath/reduction.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/numpy/core/src/umath/reduction.c b/numpy/core/src/umath/reduction.c index b2b4db012..79adb0051 100644 --- a/numpy/core/src/umath/reduction.c +++ b/numpy/core/src/umath/reduction.c @@ -198,7 +198,6 @@ conform_reduce_result(PyArrayObject *in, const npy_bool *axis_flags, } if (PyArray_SetWritebackIfCopyBase(ret_copy, (PyArrayObject *)ret) < 0) { - Py_DECREF(ret); Py_DECREF(ret_copy); return NULL; } |