diff options
-rw-r--r-- | numpy/core/src/multiarray/methods.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/core/src/multiarray/methods.c b/numpy/core/src/multiarray/methods.c index c81f4b1a8..18ff1ec51 100644 --- a/numpy/core/src/multiarray/methods.c +++ b/numpy/core/src/multiarray/methods.c @@ -1868,7 +1868,9 @@ array_dot(PyArrayObject *self, PyObject *args, PyObject *kwds) if (out == NULL) { ret = PyObject_CallMethodObjArgs(numpycore, fname, self, b, NULL); } - ret = PyObject_CallMethodObjArgs(numpycore, fname, self, b, out, NULL); + else { + ret = PyObject_CallMethodObjArgs(numpycore, fname, self, b, out, NULL); + } Py_DECREF(fname); return ret; } |