]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
More tidies to objcopy archive handling
authorAlan Modra <amodra@gmail.com>
Fri, 14 Jul 2023 01:17:30 +0000 (10:47 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 14 Jul 2023 02:23:48 +0000 (11:53 +0930)
commit6d872a1a807dc3f347808e853111dec7770ee0a9
tree6afe7f57e29782ff440a57bceb630074bc6ecb14
parent478409b71d3e80647904540e518897667bd352b2
More tidies to objcopy archive handling

This makes sure copy_archive exits with ibfd and obfd closed.  Error
paths didn't do that, leading to memory leaks.  None of this matters
very much.

* objcopy.c (copy_archive): bfd_close ibfd and obfd on error
return paths.  Remove braces around "list" free.
(copy_file): Don't close invalid file descriptor.
binutils/objcopy.c