commit 5f4b42abc730186afe19b889b6526bc244b8669d
parent c6b41eb8c8cece8266b2173a83216e1ce77eb2be
Author: Quentin Carbonneaux <quentin@c9x.me>
Date: Mon, 11 Apr 2022 14:35:19 +0200
do not leak type fields
Thanks to Daniel Xu for reporting.
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/parse.c b/parse.c
@@ -1092,6 +1092,7 @@ void
parse(FILE *f, char *path, void data(Dat *), void func(Fn *))
{
Lnk lnk;
+ uint n;
lexinit();
inf = f;
@@ -1115,6 +1116,9 @@ parse(FILE *f, char *path, void data(Dat *), void func(Fn *))
parsetyp();
break;
case Teof:
+ for (n=0; n<ntyp; n++)
+ if (typ[n].nunion)
+ vfree(typ[n].fields);
vfree(typ);
return;
}