Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] Fix double free on error while inserting the breakpoint
Date: Thu, 23 Apr 2009 22:40:00 -0000	[thread overview]
Message-ID: <20090423224017.GA26409@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <m3iqkvqcz7.fsf@fleche.redhat.com>

On Thu, 23 Apr 2009 23:25:32 +0200, Tom Tromey wrote:
> Looks good to me, please check it in.

Checked-in.


Thanks,
Jan


http://sourceware.org/ml/gdb-cvs/2009-04/msg00172.html

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.

--- src/gdb/breakpoint.c	2009/03/31 16:44:17	1.390
+++ src/gdb/breakpoint.c	2009/04/23 22:38:24	1.391
@@ -5458,8 +5458,6 @@
 			 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 @@
       b->ops = ops;
       b->enable_state = enabled ? bp_enabled : bp_disabled;
 
-      update_global_location_list (1);
       mention (b);
     }
   
@@ -5812,6 +5809,9 @@
   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. 


      reply	other threads:[~2009-04-23 22:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-24  3:35 Jan Kratochvil
2009-04-22 23:11 ` Tom Tromey
2009-04-23 20:36   ` Jan Kratochvil
2009-04-23 21:25     ` Tom Tromey
2009-04-23 22:40       ` Jan Kratochvil [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090423224017.GA26409@host0.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox