* src/tgbaparse/tgbaparse.yy: Add `%destructor's so the parser

does not leak on errors.
* src/tgbatest/ltl2tgba.cc: Free the automata if it could not be
fully parsed.
This commit is contained in:
Alexandre Duret-Lutz 2004-11-08 14:43:10 +00:00
parent 86ff462fa4
commit 7afd10420a
3 changed files with 20 additions and 2 deletions

View file

@ -410,7 +410,11 @@ main(int argc, char** argv)
spot::tgba_explicit* e;
to_free = a = e = spot::tgba_parse(input, pel, dict, env, debug_opt);
if (spot::format_tgba_parse_errors(std::cerr, pel))
return 2;
{
delete to_free;
delete dict;
return 2;
}
e->merge_transitions();
}
else