PR22212, memory leak in nm
authorAlan Modra <amodra@gmail.com>
Mon, 9 Oct 2017 02:51:44 +0000 (13:21 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 9 Oct 2017 02:53:00 +0000 (13:23 +1030)
PR 22212
* dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
funcinfo_hash_table and varinfo_hash_table.

bfd/ChangeLog
bfd/dwarf2.c

index 4cb07152937f7557c3cd4d322c147848d9c7b8c8..c334e53307bb256b696945fc1b0d38edf3daff18 100644 (file)
@@ -1,3 +1,9 @@
+2017-10-09  Alan Modra  <amodra@gmail.com>
+
+       PR 22212
+       * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
+       funcinfo_hash_table and varinfo_hash_table.
+
 2017-10-08  H.J. Lu  <hongjiu.lu@intel.com>
 
        * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
index 248e621ad3305dd73b17dd5996ea274ca760b13b..ef380dd6823b31e675121c90f02dc9c53514910c 100644 (file)
@@ -4927,6 +4927,10 @@ _bfd_dwarf2_cleanup_debug_info (bfd *abfd, void **pinfo)
        }
     }
 
+  if (stash->funcinfo_hash_table)
+    bfd_hash_table_free (&stash->funcinfo_hash_table->base);
+  if (stash->varinfo_hash_table)
+    bfd_hash_table_free (&stash->varinfo_hash_table->base);
   if (stash->dwarf_abbrev_buffer)
     free (stash->dwarf_abbrev_buffer);
   if (stash->dwarf_line_buffer)