From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27202 invoked by alias); 1 Jul 2007 15:50:21 -0000 Received: (qmail 27193 invoked by uid 22791); 1 Jul 2007 15:50:21 -0000 X-Spam-Check-By: sourceware.org Received: from a.mail.sonic.net (HELO a.mail.sonic.net) (64.142.16.245) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 01 Jul 2007 15:50:19 +0000 Received: from snyder (209-204-172-156.dsl.dynamic.sonic.net [209.204.172.156]) by a.mail.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with SMTP id l61FoG81008660; Sun, 1 Jul 2007 08:50:16 -0700 Message-ID: <004401c7bbf7$8a7b4880$677ba8c0@sonic.net> Reply-To: "Michael Snyder" From: "Michael Snyder" To: "Daniel Jacobowitz" Cc: References: <18552.12.7.175.2.1183082732.squirrel@webmail.sonic.net> <20070701153828.GB10872@caradoc.them.org> Subject: Re: [patch] unfreed memory in cli_command_loop Date: Sun, 01 Jul 2007 15:50:00 -0000 X-Mailer: Microsoft Outlook Express 6.00.2800.1437 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/msg00009.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. Whoa, you're right, thanks for the catch.