From: Pablo Neira Ayuso <pablo@netfilter.org>
To: "Carlos Falgueras García" <carlosfg@riseup.net>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 1/2,libnftnl] Free user data in unsetters
Date: Thu, 2 Jun 2016 12:58:40 +0200 [thread overview]
Message-ID: <20160602105840.GC3013@salvia> (raw)
In-Reply-To: <20160602105538.GA3013@salvia>
On Thu, Jun 02, 2016 at 12:55:38PM +0200, Pablo Neira Ayuso wrote:
> On Thu, Jun 02, 2016 at 12:40:23PM +0200, Carlos Falgueras García wrote:
> > Signed-off-by: Carlos Falgueras García <carlosfg@riseup.net>
> > ---
> > src/rule.c | 2 ++
> > src/set_elem.c | 2 ++
> > 2 files changed, 4 insertions(+)
> >
> > diff --git a/src/rule.c b/src/rule.c
> > index 8ee8648..3576e32 100644
> > --- a/src/rule.c
> > +++ b/src/rule.c
> > @@ -112,6 +112,8 @@ void nftnl_rule_unset(struct nftnl_rule *r, uint16_t attr)
> > case NFTNL_RULE_POSITION:
> > case NFTNL_RULE_FAMILY:
> > case NFTNL_RULE_USERDATA:
> > + xfree(r->user.data);
> > + r->user.len = 0;
>
> I think we don't need to reset user.len, right?
BTW, I'd suggest you call this: "Fix leak in nftnl_rule_unset()"
I would review other any other existing unsetter to see if we're also
leaking there. 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
prev parent reply other threads:[~2016-06-02 10:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-02 10:40 [PATCH 1/2,libnftnl] Free user data in unsetters Carlos Falgueras García
2016-06-02 10:40 ` [PATCH 2/2,libnftnl] Check memory allocations in setters Carlos Falgueras García
2016-06-02 10:57 ` Pablo Neira Ayuso
2016-06-02 10:55 ` [PATCH 1/2,libnftnl] Free user data in unsetters Pablo Neira Ayuso
2016-06-02 10:58 ` Pablo Neira Ayuso [this message]
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=20160602105840.GC3013@salvia \
--to=pablo@netfilter.org \
--cc=carlosfg@riseup.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).