From af979654f9098232b18c6f3c3b40c54143d13629 Mon Sep 17 00:00:00 2001 From: Phil Oester Date: Sat, 30 Nov 2013 12:15:52 -0800 Subject: rule: missing set cleanup in do_command_list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Phil Oester Signed-off-by: Pablo Neira Ayuso --- src/rule.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/rule.c b/src/rule.c index 39a66d71..ec8b6a48 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; } -- cgit v1.2.3