diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index be134d3d3..6723e4ec2 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -474,7 +474,7 @@ class SparseMatrix { if(m_innerNonZeros != 0) return; - m_innerNonZeros = new Index[m_outerSize]; + m_innerNonZeros = static_cast(std::malloc(m_outerSize * sizeof(Index))); for (int i = 0; i < m_outerSize; i++) { m_innerNonZeros[i] = m_outerIndex[i+1] - m_outerIndex[i];