2012-02-25 Luis Machado <lgustavo@codesourcery.com>
authorLuis Machado <luisgpm@br.ibm.com>
Sat, 25 Feb 2012 19:54:50 +0000 (19:54 +0000)
committerLuis Machado <luisgpm@br.ibm.com>
Sat, 25 Feb 2012 19:54:50 +0000 (19:54 +0000)
* mem-break.c (clear_gdb_breakpoint_conditions): Fix de-allocation
of conditions.

gdb/gdbserver/ChangeLog
gdb/gdbserver/mem-break.c

index 64ecbf99d01e34a5dccaab7d11041d53009f72b2..1e2f5e9f7275ce9122d839a832b2eae1280fec1b 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-25  Luis Machado  <lgustavo@codesourcery.com>
+
+       * mem-break.c (clear_gdb_breakpoint_conditions): Fix de-allocation
+       of conditions.
+
 2012-02-24  Maciej W. Rozycki  <macro@codesourcery.com>
 
        * linux-mips-low.c (mips_regmap): Correct the index of $f9.
index c9a60358437407c7459eddc77478583b881c96b1..6b6b25c15310596095c79ec32cd45c2204e975ca 100644 (file)
@@ -726,20 +726,22 @@ void
 clear_gdb_breakpoint_conditions (CORE_ADDR addr)
 {
   struct breakpoint *bp = find_gdb_breakpoint_at (addr);
-  struct point_cond_list *cond, **cond_p;
+  struct point_cond_list *cond;
 
   if (bp == NULL || bp->cond_list == NULL)
     return;
 
   cond = bp->cond_list;
-  cond_p = &bp->cond_list->next;
 
   while (cond != NULL)
     {
+      struct point_cond_list *cond_next;
+
+      cond_next = cond->next;
+      free (cond->cond->bytes);
       free (cond->cond);
       free (cond);
-      cond = *cond_p;
-      cond_p = &cond->next;
+      cond = cond_next;
     }
 
   bp->cond_list = NULL;