aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2008-05-21 11:46:42 +0000
committerNick Clifton <nickc@redhat.com>2008-05-21 11:46:42 +0000
commit90b5b1a5e42372c0fde6186d08235aa4746d9707 (patch)
treeb41aea5b461938a39e72ec559f266929e7a7b227 /bfd
parent41911f68522e3043ab6f32594eea32cdd8581a14 (diff)
downloadgdb-90b5b1a5e42372c0fde6186d08235aa4746d9707.zip
gdb-90b5b1a5e42372c0fde6186d08235aa4746d9707.tar.gz
gdb-90b5b1a5e42372c0fde6186d08235aa4746d9707.tar.bz2
PR 868
* dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free memory allocated for filenames in function tables and variable tables.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/dwarf2.c29
2 files changed, 35 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index ba07dad..55b1560 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2008-05-21 André Johansen <andrejoh@gmail.com>
+
+ PR 868
+ * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free memory allocated
+ for filenames in function tables and variable tables.
+
2008-05-19 Alan Modra <amodra@bigpond.net.au>
PR 2995, PR 6473
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index d0b50ff..34e0138 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -3202,6 +3202,8 @@ _bfd_dwarf2_cleanup_debug_info (bfd *abfd)
for (each = stash->all_comp_units; each; each = each->next_unit)
{
struct abbrev_info **abbrevs = each->abbrevs;
+ struct funcinfo *function_table = each->function_table;
+ struct varinfo *variable_table = each->variable_table;
size_t i;
for (i = 0; i < ABBREV_HASH_SIZE; i++)
@@ -3220,6 +3222,33 @@ _bfd_dwarf2_cleanup_debug_info (bfd *abfd)
free (each->line_table->dirs);
free (each->line_table->files);
}
+
+ while (function_table)
+ {
+ if (function_table->file)
+ {
+ free (function_table->file);
+ function_table->file = NULL;
+ }
+
+ if (function_table->caller_file)
+ {
+ free (function_table->caller_file);
+ function_table->caller_file = NULL;
+ }
+ function_table = function_table->prev_func;
+ }
+
+ while (variable_table)
+ {
+ if (variable_table->file)
+ {
+ free (variable_table->file);
+ variable_table->file = NULL;
+ }
+
+ variable_table = variable_table->prev_var;
+ }
}
free (stash->dwarf_abbrev_buffer);