summaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-08-02 12:01:01 -0600
committerTom Tromey <tom@tromey.com>2022-08-03 13:26:58 -0600
commit88c4cce8d28e6be486cb25fbbccf2b42e40da45b (patch)
treedf842da69d935024ed54f49f827f4fc1cd634b6d /bfd/elf.c
parent075e4d6d95681bfbf53e849c2802a75d1d4cbdca (diff)
Use unique_ptr to destroy per-bfd object
In some cases, the objfile owns the per-bfd object. This is yet another object that can sometimes be destroyed before the registry is destroyed, possibly reslting in a use-after-free. Also, I noticed that the condition for deleting the object is not the same as the condition used to create it -- so it could possibly result in a memory leak in some situations. This patch fixes the problem by introducing a new unique_ptr that holds this object when necessary.
Diffstat (limited to 'bfd/elf.c')
0 files changed, 0 insertions, 0 deletions