From: Jaska Uimonen Date: Mon, 27 Jul 2015 08:20:05 +0000 (+0300) Subject: fix possible resource leak with yynultrans_tbl X-Git-Tag: v2.6.0~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b4b8b7ed81830067ca449e3bafcfa6ac034bcd16;p=flex fix possible resource leak with yynultrans_tbl --- 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 */ }