This is the mail archive of the gdb-patches@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]

[ob] Fix the bug chng-syms.exp is testing for


When Andrew cleaned up Paul's patch, the first chunk got lost.  This just
happens to be the one the testsuite was testing for - the other three were
for watchpoints, and this one is for breakpoints.  This could lead to
unexpected output in the testsuite (which served as a pass), or to an
infinite loop in malloc.

Committed as obvious.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2004-01-31  Daniel Jacobowitz  <drow@mvista.com>

	* breakpoint.c (breakpoint_re_set_one): Add missing chunk of
	2004-01-27 double-free fix.

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.152
diff -u -p -r1.152 breakpoint.c
--- breakpoint.c	28 Jan 2004 01:39:51 -0000	1.152
+++ breakpoint.c	31 Jan 2004 18:10:55 -0000
@@ -6902,7 +6902,12 @@ breakpoint_re_set_one (void *bint)
 	    {
 	      s = b->cond_string;
 	      if (b->cond)
-		xfree (b->cond);
+		{
+		  xfree (b->cond);
+		  /* Avoid re-freeing b->exp if an error during the call
+		     to parse_exp_1.  */
+		  b->cond = NULL;
+		}
 	      b->cond = parse_exp_1 (&s, block_for_pc (sals.sals[i].pc), 0);
 	    }
 


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