aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2018-10-20 21:38:39 +0200
committerAnders Broman <a.broman58@gmail.com>2018-10-21 06:58:32 +0000
commitbb2caa2a9fcb131ad47b4648dd196cc278847d85 (patch)
treef6fd2956b26247c8885ac5e32ae508f8a47da02a
parent5188a1a38ef44e4a5c2188c89838576fd18f55a9 (diff)
lemon: fix memleak in ReportTable
Building without -DENABLE_ASAN=1 but with -fsanitize=address (as is done by oss-fuzz) still triggers a memleak report. Closer inspection revealed that two other members were leaked. Change-Id: I3d022ac50c554891a73b9380b7879c1a60c3c798 Reviewed-on: https://code.wireshark.org/review/30289 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--tools/lemon/lemon.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/lemon/lemon.c b/tools/lemon/lemon.c
index faa8530870..f2e541a549 100644
--- a/tools/lemon/lemon.c
+++ b/tools/lemon/lemon.c
@@ -615,13 +615,11 @@ struct acttab {
#define acttab_yylookahead(X,N) ((X)->aAction[N].lookahead)
/* Free all memory associated with the given acttab */
-#if 0
PRIVATE void acttab_free(acttab *p){
free( p->aAction );
free( p->aLookahead );
free( p );
}
-#endif
/* Allocate a new acttab structure */
PRIVATE acttab *acttab_alloc(int nsymbol, int nterminal) {
@@ -4436,7 +4434,7 @@ void ReportTable(
}
}
fprintf(out, "};\n"); lineno++;
- free(pActtab);
+ acttab_free(pActtab);
/* Output the yy_shift_ofst[] table */
n = lemp->nxstate;