This fixes a memory leak in the vanishingly rare cases (found by
fuzzers of course) when something goes wrong in the save_section_vma,
htab_create_alloc or alloc_trie_leaf calls before *pinfo is written.
If *pinfo is not written, _bfd_dwarf2_cleanup_debug_info won't be able
to free that memory.
* dwarf2.c (_bfd_dwarf2_slurp_debug_info): Save stash pointer
on setting up stash.
stash = (struct dwarf2_debug *) bfd_zalloc (abfd, amt);
if (! stash)
return false;
+ *pinfo = stash;
}
stash->orig_bfd = abfd;
stash->debug_sections = debug_sections;
if (!stash->alt.trie_root)
return false;
- *pinfo = stash;
-
if (debug_bfd == NULL)
debug_bfd = abfd;