From 09c9e8091c36eff7f1f4220ac12afe66d0322c59 Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Fri, 1 Nov 2019 08:14:05 -0500 Subject: libdw: Don't free uninitialized Dwarf_Abbrev_Hash's of "fake" CUs. fake_{loc,loclists,addr}_cu are Dwarf_CUs that are created separate from all the others, so their contents are minimal and mostly initialized by a calloc. On dwarf_end however, they are freed through the same code path as all the others, so they call DAH_free like all the others. This changes that so that these three are exempt from DAH and split-DWARF matters, and swaps the calloc for a malloc so Memcheck will catch any others. Signed-off-by: Jonathon Anderson --- libdw/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libdw/ChangeLog') diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 394c0df2..b1f73bc8 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,9 @@ +2019-11-01 Jonathon Anderson + + * dwarf_begin_elf.c (valid_p): Switch calloc for malloc for fake CUs. + Add explicit initialization of some fields. + * dwarf_end.c (cu_free): Add clause to limit freeing of CU internals. + 2019-08-26 Jonathon Anderson * libdw_alloc.c (__libdw_allocate): Added thread-safe stack allocator. -- cgit v1.2.3