# HG changeset patch # User John W. Eaton # Date 1382027548 14400 # Node ID 9f6e4e5c2bac5b7933be27415086bb732ffb1fdb # Parent 36917b3db6b2654ad6f824143cd9a2a383c9510f avoid memory leak in parser (bug #40231) * oct-parse.in.yy (octave_base_parser::make_try_command): If an an error identifier is extracted from the list of cleanup statements, delete the first statement from the list. diff -r 36917b3db6b2 -r 9f6e4e5c2bac libinterp/parse-tree/oct-parse.in.yy --- a/libinterp/parse-tree/oct-parse.in.yy Thu Oct 17 09:11:24 2013 -0700 +++ b/libinterp/parse-tree/oct-parse.in.yy Thu Oct 17 12:32:28 2013 -0400 @@ -2390,6 +2390,9 @@ id = dynamic_cast (expr); cleanup_stmts->pop_front (); + + stmt->set_expression (0); + delete stmt; } } }