This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

pending/981: [RFA] Fix a small memory leak in bpstat_stop_status


>Number:         981
>Category:       pending
>Synopsis:       [RFA] Fix a small memory leak in bpstat_stop_status
>Confidential:   yes
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   unknown
>Arrival-Date:   Fri Jan 31 04:58:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 --XF85m9dhOBO43t/C
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 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
 
 --XF85m9dhOBO43t/C
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="leak.diff"
 
 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.  */
 
 --XF85m9dhOBO43t/C--
 
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]