This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] PR22212, memory leak in nm
- From: Alan Modra <amodra at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 9 Oct 2017 04:50:27 -0000
- Subject: [binutils-gdb] PR22212, memory leak in nm
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b55ec8b676ed05d93ee49d6c79ae0403616c4fb0
commit b55ec8b676ed05d93ee49d6c79ae0403616c4fb0
Author: Alan Modra <amodra@gmail.com>
Date: Mon Oct 9 13:21:44 2017 +1030
PR22212, memory leak in nm
PR 22212
* dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
funcinfo_hash_table and varinfo_hash_table.
Diff:
---
bfd/ChangeLog | 6 ++++++
bfd/dwarf2.c | 4 ++++
2 files changed, 10 insertions(+)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 4cb0715..c334e53 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 248e621..ef380dd6 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -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)