From 3a63c4b7c363792f556dcf1247aa18721a3d140c Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 4 Jan 2005 13:31:46 +0000 Subject: [PATCH] * breakpoint.c (break_command_1): Always free err_msg before returning when an exception was caught. --- gdb/ChangeLog | 5 +++++ gdb/breakpoint.c | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index beddd4a5fe0..5c483c0efa1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2005-01-04 Andreas Schwab + + * breakpoint.c (break_command_1): Always free err_msg before + returning when an exception was caught. + 2005-01-01 Joel Brobecker * hppa-tdep.c (prologue_inst_adjust_sp): Fix small confusion diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 57749203749..20134e579d0 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -5141,7 +5141,10 @@ break_command_1 (char *arg, int flag, int from_tty, struct breakpoint *pending_b { /* If called to resolve pending breakpoint, just return error code. */ if (pending_bp) - return rc; + { + xfree (err_msg); + return rc; + } error_output_message (NULL, err_msg); xfree (err_msg); @@ -5169,7 +5172,10 @@ break_command_1 (char *arg, int flag, int from_tty, struct breakpoint *pending_b pending = 1; } else - return rc; + { + xfree (err_msg); + return rc; + } } else if (!sals.nelts) return GDB_RC_FAIL; -- 2.30.2