summaryrefslogtreecommitdiff
path: root/scipy/base/src/arraymethods.c
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2005-11-04 21:31:12 +0000
committerTravis Oliphant <oliphant@enthought.com>2005-11-04 21:31:12 +0000
commitc0719756b15d65e3398631e3ebf1075906a7b87e (patch)
tree7037c3e1c7906087965849b15d553fab71a5ff8c /scipy/base/src/arraymethods.c
parentab695d0085440fcfb59f36a26309fea055667046 (diff)
downloadnumpy-c0719756b15d65e3398631e3ebf1075906a7b87e.tar.gz
valgrind-found fixes and adjust indexing for object arrays.
Diffstat (limited to 'scipy/base/src/arraymethods.c')
-rw-r--r--scipy/base/src/arraymethods.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/scipy/base/src/arraymethods.c b/scipy/base/src/arraymethods.c
index dea12cc48..449736e87 100644
--- a/scipy/base/src/arraymethods.c
+++ b/scipy/base/src/arraymethods.c
@@ -110,7 +110,10 @@ array_reshape(PyArrayObject *self, PyObject *args)
}
}
- if (newshape.len == 1) return PyArray_Ravel(self, 0);
+ if (newshape.len == 1) {
+ PyDimMem_FREE(newshape.ptr);
+ return PyArray_Ravel(self, 0);
+ }
if ((newshape.len == 0) || PyArray_ISCONTIGUOUS(self)) {
ret = PyArray_Newshape(self, &newshape);
@@ -135,6 +138,7 @@ array_reshape(PyArrayObject *self, PyObject *args)
}
PyDimMem_FREE(newshape.ptr);
return _ARET(ret);
+
fail:
PyDimMem_FREE(newshape.ptr);
return NULL;