Re: mempool / xfree abuse

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 15 Aug 2000 19:54:59 +0200

Well, that is a bad thing for the memPool accounting, but that is
curently all. At least until memory pools are rewritten to handle blocks
of allocated structures.

Yes, it should be fixed.

Btw, how do you detect the difference in xfree? All memPoolAlloc does it
to return areas allocated with xcalloc(). It does not keep track of the
allocated areas, only how much it has given out...

/Henrik

Adrian Chadd wrote:
>
> Checking out squid-cvs I was alerted to find something evil in the ACL code.
> Looking at aclParseAccessLine(), A is allocated by a call to MemAlloc(),
> and then freed by a call to xfree(). xfree() doesn't if its a mempool
> rather than a malloc'ed block.
>
> I think this is a bad thing, and I bet that this same thing exists in other
> places in the code. Has anyone got any quick clue on this? I'm tempted to
> stick a test in xfree() to panic on a mempool'ed block and fix them, but
> if someone else has a better idea feel free to tell me.
>
> Adrian
> --
> Adrian Chadd "If Pascal was elite it would be cool,
> <adrian@creative.net.au> but it isn't, so its not."
> -Joshua Goodall
Received on Tue Aug 15 2000 - 11:54:49 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:34 MST