summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2015-11-25 01:51:47 +0200
committerTobias Klauser <tklauser@distanz.ch>2015-11-25 09:13:03 +0100
commit3f2f363485d3da15bc2c397ea1f1705b4f377b23 (patch)
tree4a2ce6c1a11518d32fd08714ec02d0cd5c345f80
parent5cac312a213b527080b3d87278fc6762e62533fb (diff)
trafgen: Make sure yyin is set before close it
In case if cpp failed then it is possible that trafgen may hang on closing uninitialized yyin. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--trafgen_parser.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/trafgen_parser.y b/trafgen_parser.y
index afcb3e2..44751ab 100644
--- a/trafgen_parser.y
+++ b/trafgen_parser.y
@@ -625,7 +625,7 @@ void compile_packets(char *file, bool verbose, unsigned int cpu, bool invoke_cpp
ret = 0;
err:
- if (yyin != stdin)
+ if (yyin && yyin != stdin)
fclose(yyin);
if (invoke_cpp)