From 412c89dd5313d6acdd3c99b72df79c584d991b1f Mon Sep 17 00:00:00 2001 From: Luis Machado Date: Sat, 25 Feb 2012 19:54:50 +0000 Subject: [PATCH] 2012-02-25 Luis Machado * mem-break.c (clear_gdb_breakpoint_conditions): Fix de-allocation of conditions. --- gdb/gdbserver/ChangeLog | 5 +++++ gdb/gdbserver/mem-break.c | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 64ecbf99d0..1e2f5e9f72 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2012-02-25 Luis Machado + + * mem-break.c (clear_gdb_breakpoint_conditions): Fix de-allocation + of conditions. + 2012-02-24 Maciej W. Rozycki * linux-mips-low.c (mips_regmap): Correct the index of $f9. diff --git a/gdb/gdbserver/mem-break.c b/gdb/gdbserver/mem-break.c index c9a6035843..6b6b25c153 100644 --- a/gdb/gdbserver/mem-break.c +++ b/gdb/gdbserver/mem-break.c @@ -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; -- 2.34.1