diff options
author | Phil Sutter <phil@nwl.cc> | 2024-01-31 21:40:19 +0100 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2024-02-01 14:51:30 +0100 |
commit | d109e41344b8f54741c0862a44d544a713178dd3 (patch) | |
tree | 5990f301d536ff6977aa5be83c9f32889fcf2177 /iptables/ip6tables.c | |
parent | 933e605154c439218f73f48b028abbeed336c3c5 (diff) |
xshared: Introduce xtables_clear_args()
Perform struct xtables_args object deinit in a common place, even though
it merely consists of freeing any IP addresses and masks.
This fixes for a memleak in arptables-translate as the check for
h->family didn't catch the value NFPROTO_ARP.
Fixes: 5b7324e0675e3 ("nft-arp: add arptables-translate")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/ip6tables.c')
-rw-r--r-- | iptables/ip6tables.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/iptables/ip6tables.c b/iptables/ip6tables.c index 4b5d4ac6..f9ae18ae 100644 --- a/iptables/ip6tables.c +++ b/iptables/ip6tables.c @@ -892,10 +892,7 @@ int do_command6(int argc, char *argv[], char **table, e = NULL; } - free(saddrs); - free(smasks); - free(daddrs); - free(dmasks); + xtables_clear_args(&args); xtables_free_opts(1); return ret; |