diff options
author | Nick Clifton <nickc@redhat.com> | 2003-03-31 18:13:25 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2003-03-31 18:13:25 +0000 |
commit | 0ca6f74e97acea672de228a78631d4528cfa921a (patch) | |
tree | 892ef62a80921a3ddde884e31d2ce4b828d7cde3 /bfd/format.c | |
parent | 1b3cc0cd477af7f3cfc1fc7fb558804accb728d3 (diff) | |
download | binutils-redhat-0ca6f74e97acea672de228a78631d4528cfa921a.tar.gz |
Fix memory leaks
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 9af6efcbab..655ccd9f08 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 |