From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10724 invoked by alias); 3 Jul 2007 01:56:51 -0000 Received: (qmail 10715 invoked by uid 22791); 3 Jul 2007 01:56:50 -0000 X-Spam-Check-By: sourceware.org Received: from b.mail.sonic.net (HELO b.mail.sonic.net) (64.142.19.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 03 Jul 2007 01:56:48 +0000 Received: from webmail.sonic.net (b.webmail.sonic.net [64.142.100.148]) by b.mail.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id l631ukou020140; Mon, 2 Jul 2007 18:56:46 -0700 Received: from 12.7.175.2 (SquirrelMail authenticated user msnyder) by webmail.sonic.net with HTTP; Mon, 2 Jul 2007 18:56:46 -0700 (PDT) Message-ID: <8628.12.7.175.2.1183427806.squirrel@webmail.sonic.net> In-Reply-To: <20070701153828.GB10872@caradoc.them.org> References: <18552.12.7.175.2.1183082732.squirrel@webmail.sonic.net> <20070701153828.GB10872@caradoc.them.org> Date: Tue, 03 Jul 2007 01:56:00 -0000 Subject: Re: [patch] unfreed memory in cli_command_loop From: msnyder@sonic.net To: msnyder@sonic.net, gdb-patches@sourceware.org User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-07/txt/msg00055.txt.bz2 > On Thu, Jun 28, 2007 at 07:05:32PM -0700, Michael Snyder wrote: >> Minor memory leak. I checked to make sure that readline makes >> and keeps its own copy of this string, so it's OK for us to >> free our copy. > > Seems fine, but I'm not really sure when that cleanup is going to be > called. We're outside the command loop here so it hasn't recorded a > watermark to clean back to. Does it ever get run? If not, you could > use alloca and avoid the whole issue. Withdrawn, will resubmit.