On Fri, Apr 28, 2006 at 06:51:54PM +0200, Slaven Rezic wrote:

> #include <netdb.h>
> main() {
>     struct protoent *pent;
>     while(1) {
>       pent = getprotobyname("tcp");
>     }
> }

valgrind shows that the leaking function is fopen(), called from
getprotobyname_r(). It seems that getprotobyname_r() does not check if
it already has /etc/protocols open and always opens a new file
descriptor for it.

Gabor

-- 
     ---------------------------------------------------------
     MTA SZTAKI Computer and Automation Research Institute
                Hungarian Academy of Sciences
     ---------------------------------------------------------


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to