Alejandro Casagrande wrote:
>     WSAStartup($101, GInitData);
>     Result := '';
>     GetHostName(Buffer, SizeOf(Buffer));
>     phe :=GetHostByName(buffer);
>     if phe = nil then Exit;
>     pptr := PaPInAddr(Phe^.h_addr_list);
>     i := 0;
>     while pptr^[i] <> nil do
>     begin
>       result:=StrPas(inet_ntoa(pptr^[i]^));
>       Inc(i);
>     end;
>     WSACleanup;

Hmm... doesn't this leak memory in the case that GetHostByName returns 
nil (because WSACleanup never gets called because the exit-command).

-- 
Markku Uttula

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
synalist-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to