mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
diagnostics: fix memory leak in libtextstyle
* src/complain.h, src/complain.c (complain_free): New. * src/main.c: Use it.
This commit is contained in:
@@ -278,6 +278,12 @@ complain_init (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
complain_free (void)
|
||||||
|
{
|
||||||
|
caret_free ();
|
||||||
|
styled_ostream_free (errstream);
|
||||||
|
}
|
||||||
|
|
||||||
/* A diagnostic with FLAGS is about to be issued. With what severity?
|
/* A diagnostic with FLAGS is about to be issued. With what severity?
|
||||||
(severity_fatal, severity_error, severity_disabled, or
|
(severity_fatal, severity_error, severity_disabled, or
|
||||||
|
|||||||
@@ -90,6 +90,9 @@ void warnings_argmatch (char *args);
|
|||||||
/** Initialize this module. */
|
/** Initialize this module. */
|
||||||
void complain_init (void);
|
void complain_init (void);
|
||||||
|
|
||||||
|
/** Reclaim resources. */
|
||||||
|
void complain_free (void);
|
||||||
|
|
||||||
/** Initialize support for colored messages. */
|
/** Initialize support for colored messages. */
|
||||||
void complain_init_color (void);
|
void complain_init_color (void);
|
||||||
|
|
||||||
|
|||||||
@@ -234,8 +234,6 @@ main (int argc, char *argv[])
|
|||||||
timevar_stop (tv_total);
|
timevar_stop (tv_total);
|
||||||
timevar_print (stderr);
|
timevar_print (stderr);
|
||||||
|
|
||||||
caret_free ();
|
|
||||||
|
|
||||||
/* Fix input file now, even if there are errors: that's less
|
/* Fix input file now, even if there are errors: that's less
|
||||||
warnings in the following runs. */
|
warnings in the following runs. */
|
||||||
if (!fixits_empty ())
|
if (!fixits_empty ())
|
||||||
@@ -249,5 +247,7 @@ main (int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
uniqstrs_free ();
|
uniqstrs_free ();
|
||||||
|
|
||||||
|
complain_free ();
|
||||||
|
|
||||||
return complaint_status ? EXIT_FAILURE : EXIT_SUCCESS;
|
return complaint_status ? EXIT_FAILURE : EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user