Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2004-07-16 19:47:15 +0400
committerJeff Johnston <jjohnstn@redhat.com>2004-07-16 19:47:15 +0400
commitdbfd3394e9b0a7913dd27b0ba0252ec1a212b36e (patch)
tree34f090c95dd1d03248a372cf69641b16f4af6df7 /newlib
parente348b39a719c81dce44594c56daf00cc71a0f55b (diff)
2004-07-16 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdio/fvwrite.c (_sfvwrite): For asprintf family calls, if realloc fails, free up buffer as it is no longer used.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/ChangeLog6
-rw-r--r--newlib/libc/stdio/fvwrite.c6
2 files changed, 11 insertions, 1 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 4c0d460ad..faaf1255c 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,9 @@
+2004-07-16 Jeff Johnston <jjohnstn@redhat.com>
+
+ * libc/stdio/fvwrite.c (_sfvwrite): For asprintf family
+ calls, if realloc fails, free up buffer as it is no longer
+ used.
+
2004-07-07 Artem B. Bityuckiy <dedekind@oktetlabs.ru>
* libc/iconv/iconv.tex: Updated to represent recent changes.
diff --git a/newlib/libc/stdio/fvwrite.c b/newlib/libc/stdio/fvwrite.c
index 3143b01b5..f036d7483 100644
--- a/newlib/libc/stdio/fvwrite.c
+++ b/newlib/libc/stdio/fvwrite.c
@@ -129,7 +129,11 @@ _DEFUN(__sfvwrite, (fp, uio),
fp->_bf._base,
curpos + len);
if (!ptr)
- goto err;
+ {
+ /* Free buffer which is no longer used. */
+ _free_r (_REENT, fp->_bf._base);
+ goto err;
+ }
fp->_bf._base = ptr;
fp->_p = ptr + curpos;
fp->_bf._size = curpos + len;