* Call cleanup on bfd_check_format_matches error exit
@ 2020-03-04 1:17 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2020-03-04 1:17 UTC (permalink / raw)
To: binutils
Another tidy of memory.
* format.c (bfd_check_format_matches): Call cleanup on error exit.
diff --git a/bfd/format.c b/bfd/format.c
index 61f26c6042..ab98486fb4 100644
--- a/bfd/format.c
+++ b/bfd/format.c
@@ -515,6 +515,8 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching)
err_unrecog:
bfd_set_error (bfd_error_file_not_recognized);
err_ret:
+ if (cleanup)
+ cleanup (abfd);
abfd->xvec = save_targ;
abfd->format = bfd_unknown;
if (matching_vector)
@@ -544,6 +546,8 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching)
}
else if (matching_vector)
free (matching_vector);
+ if (cleanup)
+ cleanup (abfd);
if (preserve_match.marker != NULL)
bfd_preserve_finish (abfd, &preserve_match);
bfd_preserve_restore (abfd, &preserve);
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-03-04 1:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-04 1:17 Call cleanup on bfd_check_format_matches error exit Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).