Re: [PATCH nft 5/5] src: expr: remove expr_ops from struct expr

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

 



Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote:
> > -	if (ops && ops->destroy)
> > +	if (ops->destroy)
> 
> expr->ops should be always set, so I guess this is fine.
> 
> >  		ops->destroy(e);
> >  }
> >  
> > @@ -81,7 +88,8 @@ void expr_free(struct expr *expr)
> >  	if (--expr->refcnt > 0)
> >  		return;
> >  
> > -	expr_destroy(expr);
> > +	if (expr->etype != EXPR_INVALID)
> > +		expr_destroy(expr);
> 
> Any way to skip this branch?
> 
> This is for compound expressions?

Yes, they have no ops, so NULL deref.  I can add a comment.



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

  Powered by Linux