Re: [PATCH 1/2,libnftnl] Free user data in unsetters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> > ---
> >  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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux