* [PATCH] nftables: missing set cleanup in do_command_list
@ 2013-11-30 20:15 Phil Oester
2013-11-30 20:53 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Phil Oester @ 2013-11-30 20:15 UTC (permalink / raw)
To: netfilter-devel; +Cc: pablo
[-- Attachment #1: Type: text/plain, Size: 315 bytes --]
When listing a table in interactive mode, the set list is not cleaned up. Thus
the number of displayed sets grows with each successive listing. Attached
patch adds the necessary list cleanup to do_command_list.
Reported-by: Bjørnar Ness <bjornar.ness@gmail.com>
Signed-off-by: Phil Oester <kernel@linuxace.com>
[-- Attachment #2: patch-nft-set_free --]
[-- Type: text/plain, Size: 345 bytes --]
diff --git a/src/rule.c b/src/rule.c
index 39a66d7..ec8b6a4 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -665,6 +665,11 @@ static int do_command_list(struct netlink_ctx *ctx, struct cmd *cmd)
chain_free(chain);
}
+ list_for_each_entry_safe(set, nset, &table->sets, list) {
+ list_del(&set->list);
+ set_free(set);
+ }
+
return 0;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-11-30 20:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-30 20:15 [PATCH] nftables: missing set cleanup in do_command_list Phil Oester
2013-11-30 20:53 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).