[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: memory leak in getprotobyname()

From: Sven Neuhaus
Subject: Re: memory leak in getprotobyname()
Date: Tue, 02 Dec 2003 16:18:04 +0100


--On 12/02/03 09:59:46 -0500 Roman Fleysher wrote:

I am not an expert on the subject, but it looks as if getprotobyname()
allocates a structure and returns a pointer to it. Thus, each time you
call it, new structure is allocated and new pointer is returned. You can
check it with

if(getprotobyname("tcp") != getprotobyname("tcp"))
  printf("Each call allocates new structure
          (assuming these were not NULL's)\n");

my getprotobyname() always returns the same pointer (even with different parameters - it modifies the structure of course), but it still grows
memory on some machines...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]