From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: jeremy@azazel.net
Subject: [PATCH nft] libnftables: memleak when no batch commands in list
Date: Fri, 27 Sep 2019 08:38:31 +0200 [thread overview]
Message-ID: <20190927063831.9705-1-pablo@netfilter.org> (raw)
A ruleset listing triggers this bug.
Fixes: fc6d0f8b0cb1 ("libnftables: get rid of repeated initialization of netlink_ctx")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
src/libnftables.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libnftables.c b/src/libnftables.c
index a19636b22683..e20372438db6 100644
--- a/src/libnftables.c
+++ b/src/libnftables.c
@@ -34,7 +34,7 @@ static int nft_netlink(struct nft_ctx *nft,
int ret = 0;
if (list_empty(cmds))
- return 0;
+ goto out;
batch_seqnum = mnl_batch_begin(ctx.batch, mnl_seqnum_alloc(&seqnum));
list_for_each_entry(cmd, cmds, list) {
--
2.11.0
reply other threads:[~2019-09-27 6:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20190927063831.9705-1-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=jeremy@azazel.net \
--cc=netfilter-devel@vger.kernel.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).