about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--libio/genops.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 64bbb2b626..0e7b31996d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2015-08-08  Paul Pluzhnikov  <ppluzhnikov@google.com>
 
+	[BZ #16734]
+	* libio/genops.c (_IO_unbuffer_all): Free wide buffer as well.
+
+2015-08-08  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
 	[BZ #17905]
 	* catgets/Makefile (tst-catgets-mem): New test.
 	* catgets/catgets.c (catopen): Don't use unbounded alloca.
diff --git a/libio/genops.c b/libio/genops.c
index 0f5e80064e..e13b3d1390 100644
--- a/libio/genops.c
+++ b/libio/genops.c
@@ -977,6 +977,9 @@ _IO_unbuffer_all (void)
 
 	  _IO_SETBUF (fp, NULL, 0);
 
+	  if (fp->_mode > 0)
+	    _IO_wsetb (fp, NULL, NULL, 0);
+
 #ifdef _IO_MTSAFE_IO
 	  if (cnt < MAXTRIES && fp->_lock != NULL)
 	    _IO_lock_unlock (*fp->_lock);