diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2009-04-23 22:38:24 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2009-04-23 22:38:24 +0000 |
commit | 217dc9e25bce91c3e4da9ccfd7f8ccfaa360e2a7 (patch) | |
tree | 45cac08bb84f2e393e0d9f53b2bff9af1cdf300c | |
parent | b14b1491f237a685a00ba669fb8410ae9ee7f648 (diff) | |
download | gdb-217dc9e25bce91c3e4da9ccfd7f8ccfaa360e2a7.zip gdb-217dc9e25bce91c3e4da9ccfd7f8ccfaa360e2a7.tar.gz gdb-217dc9e25bce91c3e4da9ccfd7f8ccfaa360e2a7.tar.bz2 |
gdb/
Fix double free on error inserting the breakpoint instruction.
* breakpoint.c (create_breakpoints): Move the
update_global_location_list call to ...
(break_command_really): ... here together with the second local call
both unified after all the cleanups.
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/breakpoint.c | 6 |
2 files changed, 11 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0bfe563..156b2b4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2009-04-23 Jan Kratochvil <jan.kratochvil@redhat.com> + + Fix double free on error inserting the breakpoint instruction. + * breakpoint.c (create_breakpoints): Move the + update_global_location_list call to ... + (break_command_really): ... here together with the second local call + both unified after all the cleanups. + 2009-04-23 Sergio Durigan Junior <sergiodj@linux.vnet.ibm.com> Tom Tromey <tromey@redhat.com> diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index cf0c5a1..330a53a 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -5458,8 +5458,6 @@ create_breakpoints (struct symtabs_and_lines sals, char **addr_string, cond_string, type, disposition, thread, task, ignore_count, ops, from_tty, enabled); } - - update_global_location_list (1); } /* Parse ARG which is assumed to be a SAL specification possibly @@ -5800,7 +5798,6 @@ break_command_really (char *arg, char *cond_string, int thread, b->ops = ops; b->enable_state = enabled ? bp_enabled : bp_disabled; - update_global_location_list (1); mention (b); } @@ -5812,6 +5809,9 @@ break_command_really (char *arg, char *cond_string, int thread, discard_cleanups (breakpoint_chain); /* But cleanup everything else. */ do_cleanups (old_chain); + + /* error call may happen here - have BREAKPOINT_CHAIN already discarded. */ + update_global_location_list (1); } /* Set a breakpoint. |