From b4b8b7ed81830067ca449e3bafcfa6ac034bcd16 Mon Sep 17 00:00:00 2001 From: Jaska Uimonen Date: Mon, 27 Jul 2015 11:20:05 +0300 Subject: [PATCH] fix possible resource leak with yynultrans_tbl --- src/gen.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gen.c b/src/gen.c index 049cbfe..81e7c27 100644 --- a/src/gen.c +++ b/src/gen.c @@ -1525,7 +1525,7 @@ void make_tables (void) { int i; int did_eof_rule = false; - struct yytbl_data *yynultrans_tbl; + struct yytbl_data *yynultrans_tbl = NULL; skelout (); /* %% [2.0] - break point in skel */ @@ -1755,9 +1755,13 @@ void make_tables (void) 0) flexerror (_ ("Could not write yynultrans_tbl")); + } + + if (yynultrans_tbl != NULL) { yytbl_data_destroy (yynultrans_tbl); yynultrans_tbl = NULL; - } + } + /* End generating yy_NUL_trans */ } -- 2.40.0