summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2010-06-30 20:40:46 +0000
committerTravis Oliphant <oliphant@enthought.com>2010-06-30 20:40:46 +0000
commit9ea50db4b5ca3a26c05cf4df364fa40f873da545 (patch)
tree481e69cf3d03eebe95878568ea911e350e39a9df
parent0a95b13f36932bafb8bbb0d7c32b0895f50f562e (diff)
downloadnumpy-9ea50db4b5ca3a26c05cf4df364fa40f873da545.tar.gz
Fix memory-leak on dtype's found by Lisandro Dalcin.
-rw-r--r--numpy/core/src/multiarray/multiarraymodule.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/numpy/core/src/multiarray/multiarraymodule.c b/numpy/core/src/multiarray/multiarraymodule.c
index b9168a18a..32dea6df6 100644
--- a/numpy/core/src/multiarray/multiarraymodule.c
+++ b/numpy/core/src/multiarray/multiarraymodule.c
@@ -1863,7 +1863,7 @@ array_correlate2(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
static PyObject *
array_arange(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kws) {
- PyObject *o_start = NULL, *o_stop = NULL, *o_step = NULL;
+ PyObject *o_start = NULL, *o_stop = NULL, *o_step = NULL, *range=NULL;
static char *kwd[]= {"start", "stop", "step", "dtype", NULL};
PyArray_Descr *typecode = NULL;
@@ -1873,7 +1873,9 @@ array_arange(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kws) {
Py_XDECREF(typecode);
return NULL;
}
- return PyArray_ArangeObj(o_start, o_stop, o_step, typecode);
+ range = PyArray_ArangeObj(o_start, o_stop, o_step, typecode);
+ Py_XDECREF(typecode);
+ return range;
}
/*NUMPY_API