From d4409d449c10faa3917a9c9624ba90ac881f89d1 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 6 May 2020 14:39:52 +0200 Subject: nft: Don't exit early after printing help texts Follow regular code path after handling --help option to gracefully deinit and free stuff. Signed-off-by: Phil Sutter --- iptables/xtables.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'iptables/xtables.c') diff --git a/iptables/xtables.c b/iptables/xtables.c index 63a37ae8..9d2e441e 100644 --- a/iptables/xtables.c +++ b/iptables/xtables.c @@ -161,7 +161,7 @@ exit_tryhelp(int status) } static void -exit_printhelp(const struct xtables_rule_match *matches) +printhelp(const struct xtables_rule_match *matches) { printf("%s v%s\n\n" "Usage: %s -[ACD] chain rule-specification [options]\n" @@ -240,7 +240,6 @@ exit_printhelp(const struct xtables_rule_match *matches) "[!] --version -V print package version.\n"); print_extension_helps(xtables_targets, matches); - exit(0); } void @@ -724,7 +723,9 @@ void do_parse(struct nft_handle *h, int argc, char *argv[], xtables_find_match(cs->protocol, XTF_TRY_LOAD, &cs->matches); - exit_printhelp(cs->matches); + printhelp(cs->matches); + p->command = CMD_NONE; + return; /* * Option selection -- cgit v1.2.3