Fix fishy sizeof(Py_ssize_t *).

sizeof(Py_ssize_t *) == sizeof(Py_ssize_t) but it's not a portable assumption.
CID 486403
This commit is contained in:
Christian Heimes 2013-07-20 14:11:52 +02:00
parent e91ad501c5
commit abfc4d838a
1 changed files with 1 additions and 1 deletions

View File

@ -1326,7 +1326,7 @@ PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (stgdict->format == NULL) if (stgdict->format == NULL)
goto error; goto error;
stgdict->ndim = itemdict->ndim + 1; stgdict->ndim = itemdict->ndim + 1;
stgdict->shape = PyMem_Malloc(sizeof(Py_ssize_t *) * stgdict->ndim); stgdict->shape = PyMem_Malloc(sizeof(Py_ssize_t) * stgdict->ndim);
if (stgdict->shape == NULL) if (stgdict->shape == NULL)
goto error; goto error;
stgdict->shape[0] = length; stgdict->shape[0] = length;