Date: Tue, 28 Jan 2003 12:30:04 -0800 (PST) From: Sean Farley <sean-freebsd@farley.org> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/47599: Memory leak on stdout Message-ID: <200301282030.h0SKU4WE075441@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/47599; it has been noted by GNATS. From: Sean Farley <sean-freebsd@farley.org> To: David Schultz <dschultz@uclink.Berkeley.EDU> Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: bin/47599: Memory leak on stdout Date: Tue, 28 Jan 2003 14:28:42 -0600 (CST) On Tue, 28 Jan 2003, David Schultz wrote: > Thus spake Sean C. Farley <sean-freebsd@farley.org>: > > When testing an application for memory leaks, I noticed one that > > I could not get rid of. I happened to be allocated from > > /usr/src/lib/libc/stdio/makebuf.c on line 72, but only when > > printf() (or really any function) used stdout. Adding an > > fclose(stdout) to the end of my application fixed the memory > > leak. > > > > I realize this is not much of a leak, but I thought it would be > > nice to have it either documented or fixed before others run > > into this confusing leak. > > I don't think it's a bug that libc lazily allocates memory for the > three standard file descriptors. I think you should consider this a > false positive from dmalloc. Do you mean lazily deallocates memory? I think the allocation is perfectly fine. I was just wondering if there is a point at which libc was supposed to free the memory before exit. A hook similar to atexit()? Sean ----------------------- sean-freebsd@farley.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200301282030.h0SKU4WE075441>