aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-02-10 20:08:40 +1030
committerAlan Modra <amodra@gmail.com>2023-02-10 20:30:24 +1030
commit80aa6647b1678fe84b5af5595ad939b48febf6a0 (patch)
treef402c2d4366c911184ad0f5c658c32b7f479c574 /ld
parentfe8cdc8ec145a166414fc375cf2cb65d9a8085a1 (diff)
downloadfsf-binutils-gdb-80aa6647b1678fe84b5af5595ad939b48febf6a0.zip
fsf-binutils-gdb-80aa6647b1678fe84b5af5595ad939b48febf6a0.tar.gz
fsf-binutils-gdb-80aa6647b1678fe84b5af5595ad939b48febf6a0.tar.bz2
Fix mmo memory leaks
The main one here is the section buffer, which can be quite large. By using alloc rather than malloc we can leave tidying memory to the generic bfd code when the bfd is closed. bfd_check_format also releases memory when object_p fails, so while it wouldn't be wrong to bfd_release at bad_format_free in mmo_object_p, it's a little extra code and work for no gain. * mmo.c (mmo_object_p): bfd_alloc rather than bfd_malloc lop_stab_symbol. Don't free/release on error. (mmo_get_spec_section): bfd_zalloc rather than bfd_zmalloc section buffer. (mmo_scan): Free fname on another error path.
Diffstat (limited to 'ld')
0 files changed, 0 insertions, 0 deletions