mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
main: also free memory on errors
* src/derives.c (derives_free): Beware of NULL. * src/main.c (main): Let the 'finish' label include memory release.
This commit is contained in:
@@ -109,6 +109,9 @@ derives_compute (void)
|
||||
void
|
||||
derives_free (void)
|
||||
{
|
||||
free (derives[0]);
|
||||
free (derives);
|
||||
if (derives)
|
||||
{
|
||||
free (derives[0]);
|
||||
free (derives);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,6 +207,8 @@ main (int argc, char *argv[])
|
||||
timevar_pop (tv_parser);
|
||||
}
|
||||
|
||||
finish:
|
||||
|
||||
timevar_push (tv_free);
|
||||
nullable_free ();
|
||||
derives_free ();
|
||||
@@ -228,8 +230,6 @@ main (int argc, char *argv[])
|
||||
if (trace_flag & trace_bitsets)
|
||||
bitset_stats_dump (stderr);
|
||||
|
||||
finish:
|
||||
|
||||
/* Stop timing and print the times. */
|
||||
timevar_stop (tv_total);
|
||||
timevar_print (stderr);
|
||||
|
||||
Reference in New Issue
Block a user