summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaimefrio <jaime.frio@gmail.com>2014-06-04 16:22:13 -0700
committerjaimefrio <jaime.frio@gmail.com>2014-06-04 16:22:15 -0700
commita95c8e4ac10a5fa6748a0fb064eaad1d1417e327 (patch)
tree3dc9b065c60e2a2ae34c51aa508f41f3b8b9dcee
parentb3ecb0957997684cd83c141649b8a4ea98b42654 (diff)
downloadnumpy-a95c8e4ac10a5fa6748a0fb064eaad1d1417e327.tar.gz
BUG: Avoid double iterator deallocation in `ufunc_object.c`
In `PyUFunc_GeneralizedFunction`, whenever a call to `NpyIter_GetIterNext` fails, `NpyIter_Deallocate` is called twice, one right after the error check, the second in the `goto fail`. Removed the first one.
-rw-r--r--numpy/core/src/umath/ufunc_object.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index 705359cb8..d825f15e9 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -1761,7 +1761,7 @@ make_arr_prep_args(npy_intp nin, PyObject *args, PyObject *kwds)
* may be null, in which case the thread global one is fetched
* - ufunc_name: name of ufunc
*/
-static int
+static int
_check_ufunc_fperr(int errmask, PyObject *extobj, char* ufunc_name) {
int fperr;
PyObject *errobj = NULL;
@@ -2230,7 +2230,6 @@ PyUFunc_GeneralizedFunction(PyUFuncObject *ufunc,
/* Get the variables needed for the loop */
iternext = NpyIter_GetIterNext(iter, NULL);
if (iternext == NULL) {
- NpyIter_Deallocate(iter);
retval = -1;
goto fail;
}