diff options
author | Alan Modra <amodra@gmail.com> | 2023-03-29 22:03:35 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-03-30 15:18:02 +1030 |
commit | a2276a6d67195b27b91edf14081303616b2bb76e (patch) | |
tree | 160fa89452a60bdc13d21e8336bf8e966605ed87 /binutils | |
parent | 94ffdb5959fae751c58c1b49a67c16bf0ce0715d (diff) | |
download | gdb-a2276a6d67195b27b91edf14081303616b2bb76e.zip gdb-a2276a6d67195b27b91edf14081303616b2bb76e.tar.gz gdb-a2276a6d67195b27b91edf14081303616b2bb76e.tar.bz2 |
Tidy memory on addr2line failures
* addr2line.c (process_file): Close bfd on error paths.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/addr2line.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/binutils/addr2line.c b/binutils/addr2line.c index afe116a..b07302d 100644 --- a/binutils/addr2line.c +++ b/binutils/addr2line.c @@ -451,6 +451,7 @@ process_file (const char *file_name, const char *section_name, if (bfd_check_format (abfd, bfd_archive)) { non_fatal (_("%s: cannot get addresses from archive"), file_name); + bfd_close (abfd); return 1; } @@ -459,6 +460,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); + bfd_close (abfd); return 1; } @@ -468,6 +470,7 @@ process_file (const char *file_name, const char *section_name, if (section == NULL) { non_fatal (_("%s: cannot find section %s"), file_name, section_name); + bfd_close (abfd); return 1; } } |