diff options
Diffstat (limited to 'numpy/core/src')
-rw-r--r-- | numpy/core/src/scalarmathmodule.c.src | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/numpy/core/src/scalarmathmodule.c.src b/numpy/core/src/scalarmathmodule.c.src index dd86678a3..3262999a0 100644 --- a/numpy/core/src/scalarmathmodule.c.src +++ b/numpy/core/src/scalarmathmodule.c.src @@ -636,8 +636,11 @@ static PyObject * &errobj) < 0) return NULL; first = 1; - if (PyUFunc_handlefperr(errmask, errobj, retstatus, &first)) + if (PyUFunc_handlefperr(errmask, errobj, retstatus, &first)) { + Py_XDECREF(errobj); return NULL; + } + Py_XDECREF(errobj); } #endif @@ -736,8 +739,11 @@ static PyObject * &errobj) < 0) return NULL; first = 1; - if (PyUFunc_handlefperr(errmask, errobj, retstatus, &first)) + if (PyUFunc_handlefperr(errmask, errobj, retstatus, &first)) { + Py_XDECREF(errobj); return NULL; + } + Py_XDECREF(errobj); } #if @isint@ |