mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-31 22:25:25 -04:00
scanner: Plug two memory leaks
Found with both ASan leak sanitizer and Valgrind. We were trivially leaking the enum name for every arg parsed by the scanner which had one. If libxml-based DTD validation was enabled, we would also leak the DTD itself, despite diligently freeing the document, context, etc. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
f1d10fb609
commit
a2ed67e85c
1 changed files with 2 additions and 0 deletions
|
|
@ -133,6 +133,7 @@ is_dtd_valid(FILE *input, const char *filename)
|
|||
rc = xmlValidateDtd(dtdctx, doc, dtd);
|
||||
xmlFreeDoc(doc);
|
||||
xmlFreeParserCtxt(ctx);
|
||||
xmlFreeDtd(dtd);
|
||||
xmlFreeValidCtxt(dtdctx);
|
||||
/* xmlIOParseDTD consumes buffer */
|
||||
|
||||
|
|
@ -432,6 +433,7 @@ free_arg(struct arg *arg)
|
|||
free(arg->name);
|
||||
free(arg->interface_name);
|
||||
free(arg->summary);
|
||||
free(arg->enumeration_name);
|
||||
free(arg);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue