]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
elf64-ppc.c memory leaks
authorAlan Modra <amodra@gmail.com>
Tue, 14 Jan 2025 10:34:27 +0000 (21:04 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 16 Jan 2025 09:27:19 +0000 (19:57 +1030)
commitaefcec161e4ecf396ffc5bff385dba761bd1d8ad
tree7ed7d5b18400ac5dd5f1be0a006c2fc6e1be830a
parentb477fdd746f67a4d412420470965b4257f7d7111
elf64-ppc.c memory leaks

I've freed htab->relr in two places, first when we're done with it
in ppc64_elf_build_stubs, and also when freeing the hasn table to
catch cases where the linker exits early due to errors.

* elf64-ppc.c (ppc64_elf_link_hash_table_free): Free htab->relr.
(ppc64_elf_build_stubs): Also free it here.
(ppc_add_stub): Copy stub_name when creating..
(ppc64_elf_size_stubs): ..and always free stub_name.
(opd_entry_value): Free sym.
(ppc_build_one_stub): bfd_alloc stub sym name.
(build_global_entry_stubs_and_plt): Likewise.
(ppc64_elf_setup_section_lists): bfd_zalloc htab->sec_info.
bfd/elf64-ppc.c