comparison libinterp/parse-tree/oct-parse.in.yy @ 17673:9f6e4e5c2bac

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.
author John W. Eaton <jwe@octave.org>
date Thu, 17 Oct 2013 12:32:28 -0400
parents 0c5f50706ba3
children efbe746f8fa8
comparison
equal deleted inserted replaced
17672:36917b3db6b2 17673:9f6e4e5c2bac
2388 if (expr && expr->is_identifier ()) 2388 if (expr && expr->is_identifier ())
2389 { 2389 {
2390 id = dynamic_cast<tree_identifier *> (expr); 2390 id = dynamic_cast<tree_identifier *> (expr);
2391 2391
2392 cleanup_stmts->pop_front (); 2392 cleanup_stmts->pop_front ();
2393
2394 stmt->set_expression (0);
2395 delete stmt;
2393 } 2396 }
2394 } 2397 }
2395 } 2398 }
2396 2399
2397 retval = new tree_try_catch_command (body, cleanup_stmts, id, 2400 retval = new tree_try_catch_command (body, cleanup_stmts, id,