From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30631 invoked by alias); 10 Mar 2003 22:42:09 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 30624 invoked from network); 10 Mar 2003 22:42:08 -0000 Received: from unknown (HELO mail-out1.apple.com) (17.254.0.52) by 172.16.49.205 with SMTP; 10 Mar 2003 22:42:08 -0000 Received: from mailgate1.apple.com (A17-128-100-225.apple.com [17.128.100.225]) by mail-out1.apple.com (8.12.7/8.12.7) with ESMTP id h2AMg7Yv018122 for ; Mon, 10 Mar 2003 14:42:07 -0800 (PST) Received: from scv1.apple.com (scv1.apple.com) by mailgate1.apple.com (Content Technologies SMTPRS 4.2.1) with ESMTP id ; Mon, 10 Mar 2003 14:42:03 -0800 Received: from apple.com (moleja.apple.com [17.201.22.21]) by scv1.apple.com (8.11.3/8.11.3) with ESMTP id h2AMg6s16021; Mon, 10 Mar 2003 14:42:06 -0800 (PST) Date: Mon, 10 Mar 2003 22:42:00 -0000 Subject: Re: [RFA/PING] Fix a small memory leak in bpstat_stop_status Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v551) Cc: gdb-patches@sources.redhat.com To: Joel Brobecker From: Jason Molenda In-Reply-To: <20030310190348.GF967@gnat.com> Message-Id: <49B89DE7-5349-11D7-B4EE-003065BC3540@apple.com> Content-Transfer-Encoding: 7bit X-SW-Source: 2003-03/txt/msg00240.txt.bz2 My agreement doesn't help you at all :-), but this patch looks correct to me--we will leak a copy of the "silent" command in bpstat_stop_status() without this patch. Jason On Monday, March 10, 2003, at 11:03 AM, Joel Brobecker wrote: > Hello, > > Can somebody have a look at this patch please (2nd ping)? Granted, it > is > not a very important patch, it "only" fixes a small memory leak, but > I believe the change is very localized, so easy to review. > > Thanks! > > On Thu, Dec 12, 2002 at 11:40:58AM +0100, Joel Brobecker wrote: >> This is a followup on a thread that I started, archived at: >> http://sources.redhat.com/ml/gdb-patches/2002-12/msg00358.html >> >> Basically, I extracted the part that fixed a small memory leak, and >> tested it separately, as the other part of the patch is likely to be >> superseeded by another patch submitted by Klee Dienes. >> >> 2002-12-12 Joel Brobecker >> >> * breakpoint.c (bpstat_stop_status): Fix a small memory leak. >> >> No regressions on x86-linux. >> >> Ok to apply? >> -- >> Joel > >> Index: breakpoint.c >> =================================================================== >> RCS file: /cvs/src/src/gdb/breakpoint.c,v >> retrieving revision 1.100 >> diff -c -3 -p -r1.100 breakpoint.c >> *** breakpoint.c 4 Dec 2002 04:53:13 -0000 1.100 >> --- breakpoint.c 12 Dec 2002 10:21:53 -0000 >> *************** bpstat_stop_status (CORE_ADDR *pc, int n >> *** 2763,2771 **** >> /* We will stop here */ >> if (b->disposition == disp_disable) >> b->enable_state = bp_disabled; >> - bs->commands = copy_command_lines (b->commands); >> if (b->silent) >> bs->print = 0; >> if (bs->commands && >> (STREQ ("silent", bs->commands->line) || >> (xdb_commands && STREQ ("Q", bs->commands->line)))) >> --- 2767,2775 ---- >> /* We will stop here */ >> if (b->disposition == disp_disable) >> b->enable_state = bp_disabled; >> if (b->silent) >> bs->print = 0; >> + bs->commands = b->commands; >> if (bs->commands && >> (STREQ ("silent", bs->commands->line) || >> (xdb_commands && STREQ ("Q", bs->commands->line)))) >> *************** bpstat_stop_status (CORE_ADDR *pc, int n >> *** 2773,2778 **** >> --- 2777,2783 ---- >> bs->commands = bs->commands->next; >> bs->print = 0; >> } >> + bs->commands = copy_command_lines (bs->commands); >> } >> } >> /* Print nothing for this entry if we dont stop or if we dont >> print. */ > > > -- > Joel >