# HG changeset patch # User Petter T. # Date 1698423545 -7200 # Fri Oct 27 18:19:05 2023 +0200 # Node ID a69eb80179c79b5e96dfc7ed19a3eb1014e3a9d3 # Parent accc8c4546a80fdc8ca216505b8fd3a62c932ebf Fill memory leak in bytecode interpreter Loose new after refactoring of original patch * pt-bytecode-vm.cc: Don't use new diff -r accc8c4546a8 -r a69eb80179c7 libinterp/parse-tree/pt-bytecode-vm.cc --- a/libinterp/parse-tree/pt-bytecode-vm.cc Fri Oct 27 18:18:52 2023 +0200 +++ b/libinterp/parse-tree/pt-bytecode-vm.cc Fri Oct 27 18:19:05 2023 +0200 @@ -5678,19 +5678,20 @@ int n_ignored = arg0; int n_total = POP_CODE (); - auto *M = new Matrix {}; - M->resize (1, n_ignored); + + Matrix M; + M.resize (1, n_ignored); std::set set_ignored; for (int i = 0; i < n_ignored; i++) { int ignore_idx = POP_CODE (); - (*M) (i) = ignore_idx; + M (i) = ignore_idx; set_ignored.insert (ignore_idx); } - octave_value ignore_matrix {*M}; + octave_value ignore_matrix {M}; // For calls into m-functions etc auto *new_lvalue_list = new std::list {};