diff options
authorPhil Sutter <>2017-08-24 19:14:11 +0200
committerPablo Neira Ayuso <>2017-08-24 19:20:29 +0200
commitc9c565ef45396206dc450e59f8b3225407c88a88 (patch)
parent80ee176dccf6954c8cc6493283ddadba42b8f694 (diff)
scanner: Fix for wrong parameter type of scanner_destroy()
The function takes the scanner as argument, not the state. This wasn't a real issue since scanner is a void pointer, which means it's only casted around without need. So this fix is a rather cosmetic one. Signed-off-by: Phil Sutter <>
2 files changed, 2 insertions, 2 deletions
diff --git a/include/parser.h b/include/parser.h
index 0e266d60..431edfb3 100644
--- a/include/parser.h
+++ b/include/parser.h
@@ -37,7 +37,7 @@ extern void parser_init(struct mnl_socket *nf_sock, struct nft_cache *cache,
extern int nft_parse(struct nft_ctx *ctx, void *, struct parser_state *state);
extern void *scanner_init(struct parser_state *state);
-extern void scanner_destroy(struct parser_state *state);
+extern void scanner_destroy(void *scanner);
extern int scanner_read_file(void *scanner, const char *filename,
const struct location *loc);
diff --git a/src/scanner.l b/src/scanner.l
index 25e4eb1c..7d57cc14 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -856,7 +856,7 @@ void *scanner_init(struct parser_state *state)
return scanner;
-void scanner_destroy(struct parser_state *scanner)
+void scanner_destroy(void *scanner)
struct parser_state *state = yyget_extra(scanner);