diff options
author | Phil Sutter <phil@nwl.cc> | 2020-05-06 14:39:52 +0200 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2020-05-11 14:28:29 +0200 |
commit | d4409d449c10faa3917a9c9624ba90ac881f89d1 (patch) | |
tree | f53522e1e008a65466a04307378c771d0f527088 /iptables/xtables.c | |
parent | b199aca80da5741add50cce244492cc005230b66 (diff) |
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 <phil@nwl.cc>
Diffstat (limited to 'iptables/xtables.c')
-rw-r--r-- | iptables/xtables.c | 7 |
1 files changed, 4 insertions, 3 deletions
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 |