diff mbox series

[iptables] xtables-translate: Use proper clear_cs function

Message ID 20200616110802.9122-1-phil@nwl.cc
State Accepted
Delegated to: Pablo Neira
Headers show
Series [iptables] xtables-translate: Use proper clear_cs function | expand

Commit Message

Phil Sutter June 16, 2020, 11:08 a.m. UTC
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/iptables/xtables-translate.c b/iptables/xtables-translate.c
index 5aa42496b5a48..c348c4df4933c 100644
--- a/iptables/xtables-translate.c
+++ b/iptables/xtables-translate.c
@@ -316,7 +316,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);