Subject: [PATCH] bfd: avoid double free in _bfd_stab_section_find_nearest_line on the out-of-memory path

Alan Modra amodra@gmail.com
Thu Aug 27 23:00:58 GMT 2026


On Fri, Aug 28, 2026 at 01:33:55AM +0800, zkd18cjb@mail.ustc.edu.cn wrote:
> Hello binutils maintainers,
> 
> This is a robustness fix for a double free in
> _bfd_stab_section_find_nearest_line (bfd/syms.c): the normal path
> frees reloc_vector without clearing the pointer, so the OOM error path
> (goto out3) frees it a second time. Full details and reproduction
> material are on bug #34573.

Thanks for the bug report and patch.  I have applied it, along with
correcting the goto.

-- 
Alan Modra


More information about the Binutils mailing list