Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@gnat.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA] Fix a small memory leak in bpstat_stop_status
Date: Thu, 12 Dec 2002 02:48:00 -0000	[thread overview]
Message-ID: <20021212104058.GL25575@gnat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 490 bytes --]

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  <brobecker@gnat.com>

        * breakpoint.c (bpstat_stop_status): Fix a small memory leak.

No regressions on x86-linux.

Ok to apply?
-- 
Joel

[-- Attachment #2: leak.diff --]
[-- Type: text/plain, Size: 1365 bytes --]

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.  */

             reply	other threads:[~2002-12-12 10:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-12  2:48 Joel Brobecker [this message]
2003-01-13  3:22 ` Joel Brobecker
2003-03-10 19:04 ` [RFA/PING] " Joel Brobecker
2003-03-10 22:42   ` Jason Molenda
2003-03-10 23:10   ` Andrew Cagney
2003-03-11 19:07     ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021212104058.GL25575@gnat.com \
    --to=brobecker@gnat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox