[patch] fix invalid free() in HEAD's readlink.c; take two

Rob Landley rob at landley.net
Sun Sep 11 23:47:15 UTC 2005


On Sunday 11 September 2005 04:42, Bernhard Fischer wrote:
> It's too early. I'll try to wait until i'm really awake next time,
> sorry.
>
> Attached patch should be correct.
>
> - free the buffer allocated by xreadlink(), i.e. when
>   CONFIG_FEATURE_READLINK_FOLLOW isn't set or no -f was given.

Except that xreadlink is returning malloced (well, realloced) memory that 
you're now not freeing...

I took a whack at it, taking advantage of glibc's ability to malloc memory in 
realpath and cleaning up the #ifdefs while I was there.  Tell me what you 
think...

Rob




More information about the busybox mailing list