summaryrefslogtreecommitdiff
path: root/gdb/tracepoint.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2007-08-05 00:36:53 +0000
committerMichael Snyder <msnyder@vmware.com>2007-08-05 00:36:53 +0000
commit27e06d3ef06c16aee2885f589ce97531acdce7e0 (patch)
treec9f9c893244e79350bebb030a530dcf17fccc5f8 /gdb/tracepoint.c
parentef18b5a26afb78efe5fadf8a6132a25fffb58cb2 (diff)
downloadbinutils-gdb-27e06d3ef06c16aee2885f589ce97531acdce7e0.tar.gz
2007-08-04 Michael Snyder <msnyder@access-company.com>
* tracepoint.c (add_register): Off by one error. (stringify_collection_list): Free malloc buffer.
Diffstat (limited to 'gdb/tracepoint.c')
-rw-r--r--gdb/tracepoint.c7
1 files changed, 5 insertions, 2 deletions
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;
}