gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Thu, 23 Apr 2009 22:38:24 +0000 (22:38 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Thu, 23 Apr 2009 22:38:24 +0000 (22:38 +0000)
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.

gdb/ChangeLog
gdb/breakpoint.c

index 0bfe5638702b4fd2912f049b1ac378106405dd47..156b2b49c44c6dbaf04d38655096225d5f2c3e1a 100644 (file)
@@ -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>
 
index cf0c5a1772b2a42057adb6ab4b0e722b55fa4b2b..330a53a66b7cc87a1c8807ea97a0925fcc0df46d 100644 (file)
@@ -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. 
This page took 0.035221 seconds and 4 git commands to generate.