diff options
Diffstat (limited to 'bfd/format.c')
-rw-r--r-- | bfd/format.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/bfd/format.c b/bfd/format.c index 9af6efcbab5..655ccd9f08f 100644 --- a/bfd/format.c +++ b/bfd/format.c @@ -163,7 +163,11 @@ bfd_check_format_matches (abfd, format, matching) if (!abfd->target_defaulted) { if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) /* rewind! */ - return FALSE; + { + if (matching) + free ((PTR) matching_vector); + return FALSE; + } right_targ = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd)); @@ -214,7 +218,11 @@ bfd_check_format_matches (abfd, format, matching) abfd->xvec = *target; /* Change BFD's target temporarily. */ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) - return FALSE; + { + if (matching) + free ((PTR) matching_vector); + return FALSE; + } /* If _bfd_check_format neglects to set bfd_error, assume bfd_error_wrong_format. We didn't used to even pay any |