[v3] libstdc++/6594

Andreas Schwab schwab@suse.de
Fri Jun 7 14:04:00 GMT 2002


Benjamin Kosnik <bkoz@redhat.com> writes:

|> I'd much rather have people use std::stringstream. Oh well.
|> 
|> tested x86/linux
|> 
|> 2002-05-15  Benjamin Kosnik  <bkoz@redhat.com>
|> 
|> 	PR libstdc++/6594
|> 	* src/strstream.cc (strstreambuf): Fix leak.

You missed one case in strstreambuf::overflow(int).  This is tested on
i386-suse-linux.

2002-06-07  Andreas Schwab  <schwab@suse.de>

	* src/strstream.cc (strstreambuf::overflow): Set _M_buf,
	_M_buf_size and _M_buf_size_opt to the new buffer and size.

--- libstdc++-v3/src/strstream.cc.~1.8.16.1.~	2002-05-21 16:54:15.000000000 +0200
+++ libstdc++-v3/src/strstream.cc	2002-06-07 16:32:10.000000000 +0200
@@ -182,6 +182,8 @@ strstreambuf::int_type strstreambuf::ove
         old_get_offset = gptr() - eback();
       }
 
+      _M_buf = buf;
+      _M_buf_size = _M_buf_size_opt = new_size;
       setp(buf, buf + new_size);
       pbump(old_size);
 

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



More information about the Gcc-patches mailing list