If scanner_read_file() failed, the function would return an
uninitialized value.
Fixes: 3db28321b64a6 ("src: add nft_run_cmd_*() functions")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
parser_init(nft->nf_sock, &nft->cache, &state, &msgs, nft->debug_mask);
scanner = scanner_init(&state);
- if (scanner_read_file(scanner, filename, &internal_location) < 0)
+ if (scanner_read_file(scanner, filename, &internal_location) < 0) {
+ rc = NFT_EXIT_FAILURE;
goto err;
+ }
if (nft_run(nft, nft->nf_sock, scanner, &state, &msgs) != 0)
rc = NFT_EXIT_FAILURE;