From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21492 invoked by alias); 15 Apr 2002 01:56:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 21478 invoked by uid 71); 15 Apr 2002 01:56:01 -0000 Date: Sun, 14 Apr 2002 18:56:00 -0000 Message-ID: <20020415015601.21477.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Carlo Wood Subject: Re: libstdc++/6246: gcc generates code that memleaks Reply-To: Carlo Wood X-SW-Source: 2002-04/txt/msg00759.txt.bz2 List-Id: The following reply was made to PR libstdc++/6246; it has been noted by GNATS. From: Carlo Wood To: Clemens Kirchgatterer Cc: rodrigc@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: libstdc++/6246: gcc generates code that memleaks Date: Mon, 15 Apr 2002 03:51:05 +0200 On Sat, Apr 13, 2002 at 08:29:34AM +0200, Clemens Kirchgatterer wrote: > hmm, this is very strange, as it is NOT gcc's fault, but mine. > > *buf += str.str(); <-- this freazes the buffer and returns a > pointer to it. the caller is now > responsible for freeing it with delete(). No it doesn't, not since 3.0 which is conforming to the standard and where str() returns a std::string. Use std::stringstream, not std::strstream. -- Carlo Wood