NetBSD-Users archive

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

Re: xmalloc.c issue (after xfree(cp), cp is used in irealloc())



Dear Christos,

Thanks for the quick response. Yes, your fix seems to be OK. Shall I
file the PR for this issue and then you can commit the fix patch to
NetBSD trunk.

Please let me know your opinion.

Thank You,
Amol Pise

On 5/14/12, Christos Zoulas <christos%zoulas.com@localhost> wrote:
> On May 14,  6:12pm, martin%duskware.de@localhost (Martin Husemann) wrote:
> -- Subject: Re: xmalloc.c issue (after xfree(cp), cp is used in irealloc())
>
> | On Mon, May 14, 2012 at 12:04:05PM -0400, Christos Zoulas wrote:
> | > The code is clearly wrong. I guess we are lucky that it does not get
> | > invoked. Here's a fix.
> |
> | How would imalloc() ever return the same address (while it has not been
> | freed) again so the optimization could trigger now?
>
> cp is freed, and then imalloc() is called. In anycase the code I have in
> tcsh
> which is from the same Chris Kingsley's malloc frees the pointer after the
> allocation.
>
> christos
>


Home | Main Index | Thread Index | Old Index