Re: squid-3.HEAD IPAddress leak

From: Adrian Chadd <adrian@dont-contact.us>
Date: Thu, 7 Feb 2008 11:49:14 +0900

On Thu, Feb 07, 2008, Amos Jeffries wrote:
> > Amos, could you please poke the leak in IPAddress:GetAddrInfo a little?
>
> I'll give it another try. But don't hold your breath too long on that one.

Why are you trying to allocate the structure on invocation of GetAddrInfo() ?

Wouldn't it be better to simply assert the caller must provide storage for
the structure, and you simply fill it in?

That avoids a malloc/free pair (as it'll generally be in the stack frame of the
caller or it'll be embedded in some other structure) and removes this special
case allocation.

Adrian

-- 
- Xenion - http://www.xenion.com.au/ - VPS Hosting - Commercial Squid Support -
- $25/pm entry-level VPSes w/ capped bandwidth charges available in WA -
Received on Wed Feb 06 2008 - 19:37:24 MST

This archive was generated by hypermail pre-2.1.9 : Sat Mar 01 2008 - 12:00:09 MST