diff options
| author | Quentin Carbonneaux <[email protected]> | 2022-04-11 14:35:19 +0200 |
|---|---|---|
| committer | Quentin Carbonneaux <[email protected]> | 2022-04-11 14:36:36 +0200 |
| commit | 5f4b42abc730186afe19b889b6526bc244b8669d (patch) | |
| tree | 373eee4ef2211b6d247c35c254cff9d6322a5497 /parse.c | |
| parent | c6b41eb8c8cece8266b2173a83216e1ce77eb2be (diff) | |
do not leak type fields
Thanks to Daniel Xu for reporting.
Diffstat (limited to 'parse.c')
| -rw-r--r-- | parse.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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; } |
