Always free matching vector from bfd_check_format_matches
authorAlan Modra <amodra@gmail.com>
Thu, 16 Jun 2022 05:18:13 +0000 (14:48 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 16 Jun 2022 05:31:14 +0000 (15:01 +0930)
commit370426d0da768345fb53683c803d6d5a20558065
treedc3e9cab9672e0a09b4113ecf0b7365780d07fbc
parent8ad7c8be4b5705a1138f7b2922ab7611e1d61e06
Always free matching vector from bfd_check_format_matches

At least one place calling list_matching_formats failed to free the
"matching" vector from bfd_check_format_matches afterwards.  Fix that
by calling free inside list_matching_formats.

binutils/
* bucomm.c (list_matching_formats): Free arg.
* addr2line.c (process_file): Adjust to suit.
* ar.c (open_inarch, ranlib_touch): Likewise.
* coffdump.c (main): Likewise.
* nm.c (display_archive, display_file): Likewise.
* objcopy.c (copy_file): Likewise.
* objdump.c (display_object_bfd): Likewise.
* size.c (display_bfd): Likewise.
* srconv.c (main): Likewise.
ld/
* ldlang.c (load_symbols): Free "matching".
binutils/addr2line.c
binutils/ar.c
binutils/bucomm.c
binutils/coffdump.c
binutils/nm.c
binutils/objcopy.c
binutils/objdump.c
binutils/size.c
binutils/srconv.c
ld/ldlang.c