Re: vfprintf() has a 4096-byte memory leak?

2003-08-04 Thread David Schultz
On Sat, Aug 02, 2003, Ryan T. Dean wrote: Poul-Henning Kamp wrote: In message 3F2B9C59.3060209 at cytherianage.net http://lists.freebsd.org/mailman/listinfo/freebsd-current, Ryan T. Dean writes: /Hey all- / /I was doing some app debugging tonight, and noticed what appears to / /be a

vfprintf() has a 4096-byte memory leak?

2003-08-02 Thread Ryan T. Dean
Hey all- I was doing some app debugging tonight, and noticed what appears to be a memory leak in vfprintf(). I've tested it on -CURRENT and -STABLE; any program that makes use of vfprintf() (ie, uses printf) appears to have a 4096 byte memory leak. The memory is allocated on the first

Re: vfprintf() has a 4096-byte memory leak?

2003-08-02 Thread Poul-Henning Kamp
In message [EMAIL PROTECTED], Ryan T. Dean writes: Hey all- I was doing some app debugging tonight, and noticed what appears to be a memory leak in vfprintf(). This is probably the buffer which stdio uses for all I/O. Try calling setbuf(stdout, NULL); setbuf(stderr, NULL);

Re: vfprintf() has a 4096-byte memory leak?

2003-08-02 Thread Ryan T. Dean
Poul-Henning Kamp wrote: In message 3F2B9C59.3060209 at cytherianage.net http://lists.freebsd.org/mailman/listinfo/freebsd-current, Ryan T. Dean writes: /Hey all- / /I was doing some app debugging tonight, and noticed what appears to / /be a memory leak in vfprintf(). / This is probably the

Re: vfprintf() has a 4096-byte memory leak?

2003-08-02 Thread Dan Nelson
In the last episode (Aug 02), Ryan T. Dean said: Aha. setbuf(stdout, NULL); does prevent the buffer from being allocated. However, in the case of stdout and stderr, if you don't setbuf() it to null, a buffer is malloc'd. The corresponding free() is in fclose. So, if you [f]printf() to