From 881fad86fa4942571c74cdfa89831a2cd25dbe16 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 4 Oct 2017 15:59:32 +0200 Subject: evaluate: Fix debug output When introducing output_fp, debug output in src/evaluate.c was not adjusted and therefore broke. This patch restores eval debug output by applying the following changes: - Change erec_print() and erec_print_list() to take a struct output_ctx pointer as first argument and use output_fp field as destination to print to. - Drop octx_debug_dummy variable and instead use octx pointer from struct eval_ctx for debug output. - Add missing calls to erec_destroy() in eval debug output which should eliminate another mem leak. Fixes: 2535ba7006f22 ("src: get rid of printf") Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- src/cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cli.c') diff --git a/src/cli.c b/src/cli.c index 692d1731..cadc3af6 100644 --- a/src/cli.c +++ b/src/cli.c @@ -138,7 +138,7 @@ static void cli_complete(char *line) cli_nft->debug_mask, &cli_nft->output); scanner_push_buffer(scanner, &indesc_cli, line); nft_run(cli_nft, cli_nf_sock, scanner, state, &msgs); - erec_print_list(stdout, &msgs, cli_nft->debug_mask); + erec_print_list(&cli_nft->output, &msgs, cli_nft->debug_mask); xfree(line); cache_release(&cli_nft->cache); iface_cache_release(); -- cgit v1.2.3