diff options
author | Michael Droettboom <mdboom@gmail.com> | 2011-05-02 10:15:14 -0400 |
---|---|---|
committer | Mark Wiebe <mwwiebe@gmail.com> | 2011-05-02 11:43:55 -0700 |
commit | 5626f31cbf7eaa56640a8c82fa7f741cf44b8520 (patch) | |
tree | 0cca250d9b2ac7a290a9f9ad1b654ff2f898bacb | |
parent | 1611da9123c88714713e6d7c65be88c42cb65d1b (diff) | |
download | numpy-5626f31cbf7eaa56640a8c82fa7f741cf44b8520.tar.gz |
BUG: Fix memory leak in f2py_rout_wrap_call test.
-rw-r--r-- | numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c b/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c index 71bee783d..73aa40862 100644 --- a/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c +++ b/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c @@ -53,8 +53,10 @@ static PyObject *f2py_rout_wrap_call(PyObject *capi_self, dims[i] = (npy_intp)PyInt_AsLong(PySequence_GetItem(dims_capi,i)); capi_arr_tmp = array_from_pyobj(type_num,dims,rank,intent|F2PY_INTENT_OUT,arr_capi); - if (capi_arr_tmp == NULL) + if (capi_arr_tmp == NULL) { + free(dims); return NULL; + } capi_buildvalue = Py_BuildValue("N",capi_arr_tmp); free(dims); return capi_buildvalue; |