summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2015-11-25 17:20:11 +0100
committerTobias Klauser <tklauser@distanz.ch>2015-11-25 17:20:11 +0100
commitf780f9ccfc4c27decca1c28b1e8bc7628f2fc9f4 (patch)
treeaf5ead5d11a35645fb5b91278728f44ab8917559
parent3f2f363485d3da15bc2c397ea1f1705b4f377b23 (diff)
bpfc: Check yyin against NULL before calling fclose() on it
Follow 3f2f363485d3 ("trafgen: Make sure yyin is set before close it") and check the yyin pointer against NULL before attempting to call fclose() with it. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--bpf_parser.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/bpf_parser.y b/bpf_parser.y
index 8aed9dc..003c031 100644
--- a/bpf_parser.y
+++ b/bpf_parser.y
@@ -810,7 +810,7 @@ int compile_filter(char *file, int verbose, int bypass, int format,
free(labels_k[i]);
}
- if (yyin != stdin)
+ if (yyin && yyin != stdin)
fclose(yyin);
exit: