From 27e06d3ef06c16aee2885f589ce97531acdce7e0 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Sun, 5 Aug 2007 00:36:53 +0000 Subject: [PATCH] 2007-08-04 Michael Snyder * tracepoint.c (add_register): Off by one error. (stringify_collection_list): Free malloc buffer. --- gdb/ChangeLog | 5 +++++ gdb/tracepoint.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fd8b2625fa2..511f555ef5a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2007-08-04 Michael Snyder + + * tracepoint.c (add_register): Off by one error. + (stringify_collection_list): Free malloc buffer. + 2007-08-03 Michael Snyder * mi-cmd-var.c (mi_cmd_var_delete): Remove unused variable, diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index b9b9f5ee8c6..e14edee16c8 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -1162,7 +1162,7 @@ add_register (struct collection_list *collection, unsigned int regno) { if (info_verbose) printf_filtered ("collect register %d\n", regno); - if (regno > (8 * sizeof (collection->regs_mask))) + if (regno >= (8 * sizeof (collection->regs_mask))) error (_("Internal: register number %d too large for tracepoint"), regno); collection->regs_mask[regno / 8] |= 1 << (regno % 8); @@ -1489,7 +1489,10 @@ stringify_collection_list (struct collection_list *list, char *string) (*str_list)[ndx] = NULL; if (ndx == 0) - return NULL; + { + free (str_list); + return NULL; + } else return *str_list; } -- 2.30.2