summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhil Oester <kernel@linuxace.com>2013-11-30 12:15:52 -0800
committerPablo Neira Ayuso <pablo@netfilter.org>2013-11-30 21:49:40 +0100
commitaf979654f9098232b18c6f3c3b40c54143d13629 (patch)
tree12fe580e83165735a60c2c71d7412afe1481dd8e /src
parent44fc6f216c3a3ea1698ca0e20448357a94fa4adc (diff)
rule: missing set cleanup in do_command_list
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> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/rule.c5
1 files changed, 5 insertions, 0 deletions
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;
}