libattr - severe memory leaks from attr_copy_file()

Timothy Shimmin timothy.shimmin at gmail.com
Wed Feb 18 01:08:26 CST 2009


On Tue, Feb 17, 2009 at 11:04 PM, Arkadiusz Miskiewicz <arekm at maven.pl> wrote:
>
> On Tuesday 17 of February 2009, Zdenek Prikryl wrote:
> > -       free(text);
> > +       if (text)
> > +               free(text);
>
> free(NULL) is fine (on Linux at least)

Exactly - in most implementations for free I would say NULL is just fine.

And the variable, text, is assigned straight away before any use,
so I missed where the problem is.

--Tim




More information about the xfs mailing list