bug-glibc
[Top][All Lists]
Advanced

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

memory leak in getprotobyname()


From: Sven Neuhaus
Subject: memory leak in getprotobyname()
Date: Tue, 02 Dec 2003 11:00:21 +0100

Hello,

the following small C program leaks memory both on libc6 2.2.5-11.5 (woody) and libc6 2.3.2-ds1-10 (debian unstable) (these are debian linux package version numbers).

Is this a know bug? Do you have a fix?
LC_*, LANG and LANGUAGE are all unset during testing.

========================8<============================
#include <netdb.h>
#include <stdio.h>

int main(void) {
   int i;
   struct protoent *protocol=NULL;

   for (i=0; i<200000; i++) {
       protocol=getprotobyname("tcp");
   }
   printf("\n RESULT : %02x \n",protocol->p_proto);

   return 0;
}
========================8<============================

Regards,
-Sven Neuhaus




reply via email to

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