mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 16:53:02 +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
|
void
|
||||||
derives_free (void)
|
derives_free (void)
|
||||||
{
|
{
|
||||||
free (derives[0]);
|
if (derives)
|
||||||
free (derives);
|
{
|
||||||
|
free (derives[0]);
|
||||||
|
free (derives);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -207,6 +207,8 @@ main (int argc, char *argv[])
|
|||||||
timevar_pop (tv_parser);
|
timevar_pop (tv_parser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
finish:
|
||||||
|
|
||||||
timevar_push (tv_free);
|
timevar_push (tv_free);
|
||||||
nullable_free ();
|
nullable_free ();
|
||||||
derives_free ();
|
derives_free ();
|
||||||
@@ -228,8 +230,6 @@ main (int argc, char *argv[])
|
|||||||
if (trace_flag & trace_bitsets)
|
if (trace_flag & trace_bitsets)
|
||||||
bitset_stats_dump (stderr);
|
bitset_stats_dump (stderr);
|
||||||
|
|
||||||
finish:
|
|
||||||
|
|
||||||
/* Stop timing and print the times. */
|
/* Stop timing and print the times. */
|
||||||
timevar_stop (tv_total);
|
timevar_stop (tv_total);
|
||||||
timevar_print (stderr);
|
timevar_print (stderr);
|
||||||
|
|||||||
Reference in New Issue
Block a user