]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
xtables-translate: Use proper clear_cs function
authorPhil Sutter <phil@nwl.cc>
Tue, 16 Jun 2020 11:06:26 +0000 (13:06 +0200)
committerPhil Sutter <phil@nwl.cc>
Tue, 16 Jun 2020 14:30:16 +0000 (16:30 +0200)
Avoid memleaks by performing a full free of any allocated data in local
iptables_command_state variable.

Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/xtables-translate.c

index 363c8be15b3fa22bab03d22f098c810ae4613501..575fb320dc408bb10b35a79859b79009d771d2e4 100644 (file)
@@ -319,7 +319,7 @@ static int do_command_xlate(struct nft_handle *h, int argc, char *argv[],
                exit(1);
        }
 
-       xtables_rule_matches_free(&cs.matches);
+       nft_clear_iptables_command_state(&cs);
 
        if (h->family == AF_INET) {
                free(args.s.addr.v4);