tech-net archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Memory leak in if_arp.c
On Sat, Apr 12, 2014 at 08:25:48AM -0400, Greg Troxel wrote:
>
> Maxime Villard <max%M00nBSD.net@localhost> writes:
>
> > after hearing about bouyer@'s mbuf leak problem, I launched my code scanner
> > on
> > netinet/, and it found a bug:
> >
> > -------------------------- netinet/if_arp.c l.1476
> > --------------------------
> >
> > if ((m = m_gethdr(M_DONTWAIT, MT_DATA)) == NULL)
> > return;
> > [...]
> > if (tha == NULL)
> > return;
> >
> > -----------------------------------------------------------------------------
> >
> > 'm' is leaked. However, this is not my area of working; can someone fix it?
>
> I think you're right; I've made a change to free m on the error path.
> However, I think ar_tha can only fail if the protocol field is 1394, so
> with the current if_arp.h implementation, this should never have leaked.
Yes, that's what I understood too.
--
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
NetBSD: 26 ans d'experience feront toujours la difference
--
Home |
Main Index |
Thread Index |
Old Index