Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <006101c2530a$aac39d00$0202a8c0@serge> From: "Serge P. Voronin" To: Subject: memory leak in gethostbyaddr() ? Date: Tue, 3 Sep 2002 11:27:58 +0600 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_005E_01C2533C.F4A3BDB0" X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Note-from-DJ: This may be spam ------=_NextPart_000_005E_01C2533C.F4A3BDB0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Hi! I'm use gethostbyaddr() for name resolving. But when I'm call gethostbyaddr() many times, the memory, allocated by the program is growing (see attach). Why? -- Best regards, Serge P. Voronin St.Ingineer of NDT, JSC "Tekhdiagnostika", Orenburg, Russia tel. +7-(3532)-631166, fax. +7-(3532)-629441 mailto:buddie AT rambler DOT ru ------=_NextPart_000_005E_01C2533C.F4A3BDB0 Content-Type: application/octet-stream; name="testgethostbyaddr.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="testgethostbyaddr.c" #include #include #include #include #include #include #define COUNT 100000 int main(void) { int i; struct in_addr addr; struct hostent *hp; addr.s_addr = htonl(INADDR_LOOPBACK); for (i = 0; i < COUNT; i++) { hp = gethostbyaddr((char *) &addr, sizeof(addr), AF_INET); if (hp) printf("%d: %s = %s\n", i, inet_ntoa(addr), hp->h_name); else printf("%d: Resolving failed\n", i); } return 0; } ------=_NextPart_000_005E_01C2533C.F4A3BDB0 Content-Type: text/plain; charset=us-ascii -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ ------=_NextPart_000_005E_01C2533C.F4A3BDB0--