In case if cpp failed then it is possible that trafgen
may hang on closing uninitialized yyin.

Signed-off-by: Vadim Kochan <[email protected]>
---
 trafgen_parser.y | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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)
-- 
2.6.2

-- 
You received this message because you are subscribed to the Google Groups 
"netsniff-ng" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to