html: fix memory leak
Akim Demaille <[email protected]> Sun, 7 Mar 2021 08:30:05 +0100
| Newsgroups | gmane.comp.parsers.bison.patches |
|---|---|
| Message-ID | <[email protected]> |
commit 15c61fb7124766b1ec46cc3c98f2502fc602e092 Author: Akim Demaille <[email protected]> Date: Fri Feb 26 07:35:21 2021 +0100 html: fix memory leak * src/print-xml.c (print_html): Free allocated memory. diff --git a/src/print-xml.c b/src/print-xml.c index e9fb25c77..78801dbc6 100644 --- a/src/print-xml.c +++ b/src/print-xml.c @@ -543,10 +543,10 @@ print_html (void) assert (xml_flag); char *xml2html = xpath_join (pkgdatadir (), "xslt/xml2xhtml.xsl"); - + char *xsltproc = muscle_percent_define_get ("tool.xsltproc"); char const *argv[11]; int i = 0; - argv[i++] = muscle_percent_define_get ("tool.xsltproc"); + argv[i++] = xsltproc; argv[i++] = "-o"; argv[i++] = spec_html_file; argv[i++] = xml2html; @@ -572,5 +572,6 @@ print_html (void) /* termsigp */ NULL); if (status) complain (NULL, complaint, _("%s failed with status %d"), argv[0], status); + free (xsltproc); free (xml2html); }