summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2003-03-11 19:07:01 +0000
committerJoel Brobecker <brobecker@gnat.com>2003-03-11 19:07:01 +0000
commit5a5106d2a325541ee51e02b188986a03c5432d48 (patch)
treefea12abc95eee8438fe4e21b30f25ad4a60c69c0
parent4ae7cba964f4967c48b02606efb62ed6b661b081 (diff)
downloadgdb-5a5106d2a325541ee51e02b188986a03c5432d48.tar.gz
* breakpoint.c (bpstat_stop_status): Fix a small memory leak.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/breakpoint.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 3b0972e7c20..6ef2f400c4a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2003-03-11 J. Brobecker <brobecker@gnat.com>
+
+ * breakpoint.c (bpstat_stop_status): Fix a small memory leak.
+
2003-03-11 Andrew Cagney <cagney@redhat.com>
* frame.c (deprecated_update_frame_pc_hack): Don't assume a next
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 638935c274e..1ff80d779b1 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -2763,9 +2763,9 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint)
/* We will stop here */
if (b->disposition == disp_disable)
b->enable_state = bp_disabled;
- bs->commands = copy_command_lines (b->commands);
if (b->silent)
bs->print = 0;
+ bs->commands = b->commands;
if (bs->commands &&
(STREQ ("silent", bs->commands->line) ||
(xdb_commands && STREQ ("Q", bs->commands->line))))
@@ -2773,6 +2773,7 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint)
bs->commands = bs->commands->next;
bs->print = 0;
}
+ bs->commands = copy_command_lines (bs->commands);
}
}
/* Print nothing for this entry if we dont stop or if we dont print. */