diff options
author | Quentin Carbonneaux <quentin@c9x.me> | 2022-04-11 14:35:19 +0200 |
---|---|---|
committer | Quentin Carbonneaux <quentin@c9x.me> | 2022-04-11 14:36:36 +0200 |
commit | 5f4b42abc730186afe19b889b6526bc244b8669d (patch) | |
tree | 373eee4ef2211b6d247c35c254cff9d6322a5497 | |
parent | c6b41eb8c8cece8266b2173a83216e1ce77eb2be (diff) | |
download | roux-5f4b42abc730186afe19b889b6526bc244b8669d.tar.gz |
do not leak type fields
Thanks to Daniel Xu for reporting.
-rw-r--r-- | parse.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/parse.c b/parse.c index 70c291b..972c2e2 100644 --- 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; } |