# HG changeset patch # User John W. Eaton # Date 1648812350 14400 # Node ID 7ad8385ff106eaa667d257afba3b6f5ded2cb10f # Parent 2ec4bc7593cce17e329d47e6f74d90202696902d pass correct length to SparseRep idx_type_deallocate function * Sparse.cc (Sparse::resize): Pass length of m_rep->m_ncols+1 instead of m_rep->m_ncols to idx_type_deallocate function for m_rep->m_cidx deallocation. diff -r 2ec4bc7593cc -r 7ad8385ff106 liboctave/array/Sparse.cc --- a/liboctave/array/Sparse.cc Tue Mar 29 16:49:26 2022 -0400 +++ b/liboctave/array/Sparse.cc Fri Apr 01 07:25:50 2022 -0400 @@ -1023,7 +1023,7 @@ { octave_idx_type *new_cidx = m_rep->idx_type_allocate (c+1); std::copy_n (m_rep->m_cidx, std::min (c, m_rep->m_ncols) + 1, new_cidx); - m_rep->idx_type_deallocate (m_rep->m_cidx, m_rep->m_ncols); + m_rep->idx_type_deallocate (m_rep->m_cidx, m_rep->m_ncols + 1); m_rep->m_cidx = new_cidx; if (c > m_rep->m_ncols)