tech-net archive

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

Re: Memory leak in if_arp.c

Maxime Villard <> 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.

Attachment: pgpVqcWGGg5EP.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index