This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Document open_memstream() buffer should be freed. [BZ #1997]
- From: Dwayne Grant McConnell <decimal at us dot ibm dot com>
- To: libc-alpha at sources dot redhat dot com
- Date: Wed, 14 Dec 2005 15:29:16 -0600 (CST)
- Subject: [PATCH] Document open_memstream() buffer should be freed. [BZ #1997]
Here is a patch to the manual documenting the need to call free() for the
buffer allocated by open_memstream().
--
Dwayne Grant McConnell <decimal@us.ibm.com>
Lotus Notes Mail: Dwayne McConnell [Mail]/Austin/IBM@IBMUS
Lotus Notes Calendar: Dwayne McConnell [Calendar]/Austin/IBM@IBMUS
2005-12-14 Dwayne Grant McConnell <decimal@us.ibm.com>
* manual/stdio.texi (open_memstream): Document need to free
buffer.
diff -urN libc.orig/manual/stdio.texi libc/manual/stdio.texi
--- libc.orig/manual/stdio.texi 2005-09-25 14:24:55.000000000 -0400
+++ libc/manual/stdio.texi 2005-12-14 15:13:39.398982016 -0500
@@ -4853,7 +4853,8 @@
@deftypefun {FILE *} open_memstream (char **@var{ptr}, size_t *@var{sizeloc})
This function opens a stream for writing to a buffer. The buffer is
allocated dynamically (as with @code{malloc}; @pxref{Unconstrained
-Allocation}) and grown as necessary.
+Allocation}) and grown as necessary so any buffer created using
+this function must be freed by using @code{free}.
When the stream is closed with @code{fclose} or flushed with
@code{fflush}, the locations @var{ptr} and @var{sizeloc} are updated to