From: Phil Sutter Date: Wed, 19 Sep 2018 13:17:08 +0000 (+0200) Subject: xtables: Drop pointless check X-Git-Tag: v1.8.1~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=671e40a5f693029d806fa08c3df1e2015a99b6e8;p=thirdparty%2Fiptables.git xtables: Drop pointless check All commands this block handles set p->chain. Also the pointer is dereferenced before, so no point in checking for it to be non-NULL. Signed-off-by: Phil Sutter Signed-off-by: Florian Westphal --- diff --git a/iptables/xtables.c b/iptables/xtables.c index 313b985b..d6afada9 100644 --- a/iptables/xtables.c +++ b/iptables/xtables.c @@ -1160,7 +1160,7 @@ void do_parse(struct nft_handle *h, int argc, char *argv[], p->chain); } - if (p->chain && !nft_chain_exists(h, p->table, p->chain)) + if (!nft_chain_exists(h, p->table, p->chain)) xtables_error(OTHER_PROBLEM, "Chain '%s' does not exist", cs->jumpto);