[omniORB] mem leak in LibcWrapper::getaddrinfo

Duncan Grisby duncan at grisby.org
Mon Jun 2 17:59:46 BST 2003


On Monday 2 June, Hartmut Raschick wrote:

> while purifying our program under Solaris9 I saw a mem leak in the
> above function. After inspecting the source code I found that the
> buffer allocated for gethostbyname_r is indeed not freed. After also
> inspecting IP4AddrInfo, I saw that there appears to be no need to
> keep the buffer (carrying the info returned by gethostbyname_r), like
> you (omni) once did in LibcWrapper::hostent_var.
> So the code IHMO should look like this (note that with other platform-
> dependent later on in the method it's the same)

Thanks for the bug report. I've checked in what I hope is a fix for
all platforms. I can't test most of them.

> Every changed/new line preceeded by ">>>" (in line above)
> I tried to stick to your formatting style.

For future reference, please send unified or context diffs, created
with diff -u or diff -c. Ad-hoc changes created by hand are really
hard to deal with. Please use the automated tools.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list