From: Phil Oester <kernel@linuxace.com>
To: netfilter-devel@vger.kernel.org
Cc: pablo@netfilter.org
Subject: [PATCH] nftables: missing set cleanup in do_command_list
Date: Sat, 30 Nov 2013 12:15:52 -0800 [thread overview]
Message-ID: <20131130201551.GA23089@home> (raw)
[-- 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;
}
next reply other threads:[~2013-11-30 20:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-30 20:15 Phil Oester [this message]
2013-11-30 20:53 ` [PATCH] nftables: missing set cleanup in do_command_list Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131130201551.GA23089@home \
--to=kernel@linuxace.com \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).