From fb81d0169b86ced7d11bf4eff03d19f3e1ded9b4 Mon Sep 17 00:00:00 2001 From: Keith Seitz Date: Wed, 20 Mar 2013 22:17:18 +0000 Subject: [PATCH] * breakpoint.h (struct breakpoint): Add comment to extra_string indicating that this member is mallod'd. * breakpoint.c (base_breakpoint_dtor): Free extra_string. --- gdb/ChangeLog | 6 ++++++ gdb/breakpoint.c | 1 + gdb/breakpoint.h | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index aaad736..3211a43 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2013-03-20 Keith Seitz + + * breakpoint.h (struct breakpoint): Add comment to + extra_string indicating that this member is mallod'd. + * breakpoint.c (base_breakpoint_dtor): Free extra_string. + 2013-03-20 Pedro Alves PR gdb/15289 diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 0ff4683..c844187 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -12788,6 +12788,7 @@ base_breakpoint_dtor (struct breakpoint *self) { decref_counted_command_line (&self->commands); xfree (self->cond_string); + xfree (self->extra_string); xfree (self->addr_string); xfree (self->filter); xfree (self->addr_string_range_end); diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 7a2c629..68f3ed9 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -726,7 +726,8 @@ struct breakpoint there is no condition. */ char *cond_string; - /* String form of extra parameters, or NULL if there are none. */ + /* String form of extra parameters, or NULL if there are none. + Malloc'd. */ char *extra_string; /* Holds the address of the related watchpoint_scope breakpoint -- 2.7.4