changeset 14097:4804ad4ce0de stable

Plug memory leak in Matrixtype for sparse permuted matrices. * Matrixtype.cc: Plug memory leak in Matrixtype for sparse permuted matrices.
author Rik <octave@nomad.inbox5.com>
date Thu, 22 Dec 2011 12:06:52 -0800
parents 153581342e47
children ebf41239e47e
files liboctave/MatrixType.cc
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/MatrixType.cc	Thu Dec 22 12:01:35 2011 -0500
+++ b/liboctave/MatrixType.cc	Thu Dec 22 12:06:52 2011 -0800
@@ -456,11 +456,11 @@
           ((typ == MatrixType::Upper || typ == MatrixType::Permuted_Upper)
            && nrows < ncols))
         {
-          typ = MatrixType::Rectangular;
           if (typ == MatrixType::Permuted_Upper ||
               typ == MatrixType::Permuted_Lower)
             delete [] perm;
           nperm = 0;
+          typ = MatrixType::Rectangular;
         }
 
       if (typ == MatrixType::Full && ncols != nrows)
@@ -777,11 +777,11 @@
           ((typ == MatrixType::Upper || typ == MatrixType::Permuted_Upper)
            && nrows < ncols))
         {
-          typ = MatrixType::Rectangular;
           if (typ == MatrixType::Permuted_Upper ||
               typ == MatrixType::Permuted_Lower)
             delete [] perm;
           nperm = 0;
+          typ = MatrixType::Rectangular;
         }
 
       if (typ == MatrixType::Full && ncols != nrows)