diff options
author | Bradley M. Froehle <brad.froehle@gmail.com> | 2013-02-10 11:13:49 -0800 |
---|---|---|
committer | Bradley M. Froehle <brad.froehle@gmail.com> | 2013-02-10 11:33:41 -0800 |
commit | 91376d7a3b81098ba348f7dfebb71a9b95031a20 (patch) | |
tree | 9519a00f0a561d2f95e9d6e0b1b1354013566f71 /numpy/core | |
parent | 625f3cde9aeacea2289ba32286ec54a65f4f4641 (diff) | |
download | numpy-91376d7a3b81098ba348f7dfebb71a9b95031a20.tar.gz |
BUG: PyArray_LexSort allocates too much temporary memory.
PyArray_LexSort was allocating memory to hold actual PyArrayObject's
and PyArrayIterObject's, but only storing pointers to such objects
in the array.
Diffstat (limited to 'numpy/core')
-rw-r--r-- | numpy/core/src/multiarray/item_selection.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/src/multiarray/item_selection.c b/numpy/core/src/multiarray/item_selection.c index 0da921b62..31916cf40 100644 --- a/numpy/core/src/multiarray/item_selection.c +++ b/numpy/core/src/multiarray/item_selection.c @@ -1225,11 +1225,11 @@ PyArray_LexSort(PyObject *sort_keys, int axis) "need sequence of keys with len > 0 in lexsort"); return NULL; } - mps = (PyArrayObject **) PyArray_malloc(n*NPY_SIZEOF_PYARRAYOBJECT); + mps = (PyArrayObject **) PyArray_malloc(n * sizeof(PyArrayObject *)); if (mps == NULL) { return PyErr_NoMemory(); } - its = (PyArrayIterObject **) PyArray_malloc(n*sizeof(PyArrayIterObject)); + its = (PyArrayIterObject **) PyArray_malloc(n * sizeof(PyArrayIterObject *)); if (its == NULL) { PyArray_free(mps); return PyErr_NoMemory(); |