diff mbox

nftables: missing set cleanup in do_command_list

Message ID 20131130201551.GA23089@home
State Accepted
Headers show

Commit Message

Phil Oester Nov. 30, 2013, 8:15 p.m. UTC
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>

Comments

Pablo Neira Ayuso Nov. 30, 2013, 8:53 p.m. UTC | #1
On Sat, Nov 30, 2013 at 12:15:52PM -0800, Phil Oester wrote:
> 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.

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;
 }