From 35c9f72b4dca9487728170f89cd431751b17c2df Mon Sep 17 00:00:00 2001 From: Christian Bauer Date: Fri, 23 Mar 2001 18:36:41 +0000 Subject: [PATCH] fixed memory leaks in lst_to_matrix() and diag_matrix() --- ginac/matrix.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ginac/matrix.cpp b/ginac/matrix.cpp index 650799e5..cc80f7ca 100644 --- a/ginac/matrix.cpp +++ b/ginac/matrix.cpp @@ -1447,9 +1447,10 @@ ex lst_to_matrix(const lst & l) for (i=0; i cols) cols = l.op(i).nops(); - + // Allocate and fill matrix matrix &m = *new matrix(rows, cols); + m.setflag(status_flags::dynallocated); for (i=0; i j) @@ -1464,6 +1465,7 @@ ex diag_matrix(const lst & l) unsigned dim = l.nops(); matrix &m = *new matrix(dim, dim); + m.setflag(status_flags::dynallocated); for (unsigned i=0; i