aboutsummaryrefslogtreecommitdiff
path: root/binutils/addr2line.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-06-16 14:48:13 +0930
committerAlan Modra <amodra@gmail.com>2022-06-16 15:01:14 +0930
commit370426d0da768345fb53683c803d6d5a20558065 (patch)
treedc3e9cab9672e0a09b4113ecf0b7365780d07fbc /binutils/addr2line.c
parent8ad7c8be4b5705a1138f7b2922ab7611e1d61e06 (diff)
downloadgdb-370426d0da768345fb53683c803d6d5a20558065.zip
gdb-370426d0da768345fb53683c803d6d5a20558065.tar.gz
gdb-370426d0da768345fb53683c803d6d5a20558065.tar.bz2
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".
Diffstat (limited to 'binutils/addr2line.c')
-rw-r--r--binutils/addr2line.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/binutils/addr2line.c b/binutils/addr2line.c
index fd2ac80..baf1671 100644
--- a/binutils/addr2line.c
+++ b/binutils/addr2line.c
@@ -452,10 +452,7 @@ process_file (const char *file_name, const char *section_name,
{
bfd_nonfatal (bfd_get_filename (abfd));
if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
- {
- list_matching_formats (matching);
- free (matching);
- }
+ list_matching_formats (matching);
xexit (1);
}