summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2012-05-31 18:44:47 +0000
committerKeith Seitz <keiths@redhat.com>2012-05-31 18:44:47 +0000
commit9c97af57fe0799b06cbb708b89cc04210949b787 (patch)
tree853080db61aff8fec3ecc0911cb8a3b7564d8604 /gdb
parent8c34d256e9201b6742db6739457d710c69ad9383 (diff)
downloadgdb-9c97af57fe0799b06cbb708b89cc04210949b787.tar.gz
* linespec.c (decode_objc): Add cleanup to free
INFO.FILE_SYMTABS. (find_linespec_symbols): Add cleanup to free CLASSES. * symfile.c (find_separate_debug_file_by_debuglink): Add cleanup to free DEBUGLINK. * ui-out.c (clear_header_list): No need to check if HEADER_NEXT.COLHDR is NULL. Free HEADER_NEXT.COL_NAME.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog11
-rw-r--r--gdb/linespec.c2
-rw-r--r--gdb/symfile.c3
-rw-r--r--gdb/ui-out.c4
4 files changed, 17 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c09c95431f4..e2ca89fd4c1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,14 @@
+2012-05-31 Keith Seitz <keiths@redhat.com>
+
+ * linespec.c (decode_objc): Add cleanup to free
+ INFO.FILE_SYMTABS.
+ (find_linespec_symbols): Add cleanup to free CLASSES.
+ * symfile.c (find_separate_debug_file_by_debuglink): Add
+ cleanup to free DEBUGLINK.
+ * ui-out.c (clear_header_list): No need to check if
+ HEADER_NEXT.COLHDR is NULL.
+ Free HEADER_NEXT.COL_NAME.
+
2012-05-31 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
* ada-lang.c (standard_lookup): Prevent uninitialized variable
diff --git a/gdb/linespec.c b/gdb/linespec.c
index ee91adfa6a5..e678dfa1008 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -2409,6 +2409,7 @@ decode_objc (struct linespec_state *self, linespec_p ls, char **argptr)
info.state = self;
info.file_symtabs = NULL;
VEC_safe_push (symtab_p, info.file_symtabs, NULL);
+ make_cleanup (VEC_cleanup (symtab_p), &info.file_symtabs);
info.result.symbols = NULL;
info.result.minimal_symbols = NULL;
values.nelts = 0;
@@ -2949,6 +2950,7 @@ find_linespec_symbols (struct linespec_state *state,
/* Find a list of classes named KLASS. */
classes = lookup_prefix_sym (state, file_symtabs, klass);
+ make_cleanup (VEC_cleanup (symbolp), &classes);
if (!VEC_empty (symbolp, classes))
{
/* Now locate a list of suitable methods named METHOD. */
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 31da4e4842d..37d98d984ea 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1553,8 +1553,9 @@ find_separate_debug_file_by_debuglink (struct objfile *objfile)
return NULL;
}
+ cleanups = make_cleanup (xfree, debuglink);
dir = xstrdup (objfile->name);
- cleanups = make_cleanup (xfree, dir);
+ make_cleanup (xfree, dir);
terminate_after_last_dir_separator (dir);
canon_dir = lrealpath (dir);
diff --git a/gdb/ui-out.c b/gdb/ui-out.c
index aa53f3ffea5..ec68cdd2153 100644
--- a/gdb/ui-out.c
+++ b/gdb/ui-out.c
@@ -968,8 +968,8 @@ clear_header_list (struct ui_out *uiout)
{
uiout->table.header_next = uiout->table.header_first;
uiout->table.header_first = uiout->table.header_first->next;
- if (uiout->table.header_next->colhdr != NULL)
- xfree (uiout->table.header_next->colhdr);
+ xfree (uiout->table.header_next->colhdr);
+ xfree (uiout->table.header_next->col_name);
xfree (uiout->table.header_next);
}
gdb_assert (uiout->table.header_first == NULL);