Hello,

On Wed, Jun 29, 2022 at 02:34:02PM +0200, Alexander Bluhm wrote:
> On Wed, Jun 29, 2022 at 12:42:13AM +0200, Alexandr Nedvedicky wrote:
> > for example here in current ip6_input_if() we may leak memory
> > on error:
> 
> Curently we do not leak memory.  We free the mbuf in the callee,
> and check the return code in the caller.

    yes I agree. I've mis-read icmp6_error() earlier.

> 
> > another option would be to revisit all places where we call ip6_hbhchcheck()
> > and adjust caller accordingly.
> 
> I added an comment that described the error handling before commit.
> 
> > In my opinion all places where we
> > making ip6_hbhchcheck() to also free packet on error should be the
> > right thing to do.
> 
> Next diff passes the pointer further down and m_freemp(mp) sets it
> to NULL.  Also sort the parameters so that the mbuf is always first.
> Note that icmp6_error() frees the mbuf, but does not reset the
> pointer.  Fixing that would touch much more code.
> 
> ok?
> 

    diff looks good to me. thanks.

OK sashan

Reply via email to