Release bfd_alloc memory in bfd_check_format_matches
authorAlan Modra <amodra@gmail.com>
Thu, 2 Jan 2020 07:09:32 +0000 (17:39 +1030)
committerAlan Modra <amodra@gmail.com>
Sat, 4 Jan 2020 08:50:33 +0000 (19:20 +1030)
commitea933f17c3c6b9fa1daf8d03baa34f7bec855d6c
treeeb3d7a89cd4756fe63701bdf134ead32a6e3cf08
parentf24bdec48621f419fdc9dcd58f46891f062b7bc0
Release bfd_alloc memory in bfd_check_format_matches

It's a little tricky.  We can release any memory back when we have a
match failure, but after a match success which we might want to
preserve for later use the high water mark must change to that of the
matched bfd.

* format.c (bfd_check_format_matches): Add preserve_match.
Save initial bfd state in "preserve", matched bfd state in
"preserve_match".  Save just the first match.  Release
bfd_alloc memory.  Restore and finish preserved state as
appropriate on all function exit paths.
bfd/ChangeLog
bfd/format.c
This page took 0.024786 seconds and 4 git commands to generate.