Fix memory leak in bfd_get_debug_link_info_1
authorAlan Modra <amodra@gmail.com>
Wed, 29 Mar 2023 12:01:15 +0000 (22:31 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 30 Mar 2023 04:48:02 +0000 (15:18 +1030)
commitea7672c10e0b762c02fd40ce94d490b56bc14675
treea0a5df4f73e69223d1b8e6b569b09dcdae091561
parent45fec14c029491329d769eae29021b4cb0cdd2c3
Fix memory leak in bfd_get_debug_link_info_1

* opncls.c (bfd_get_alt_debug_link_info): Don't bother freeing
after bfd_malloc_and_get_section failure.
(get_build_id): Likewise.
(bfd_get_debug_link_info_1): Likewise.  Free section contents
when crc not present.
* section.c (bfd_malloc_and_get_section): Document that the
buffer is NULL on error return.
bfd/opncls.c
bfd/section.c