binutils Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
bfd

Fixes incorrect `sframe_decoder_free` calls, preventing double frees.

`sframe_decoder_free` is now called correctly, preventing potential double frees.

This patch fixes incorrect calls to sframe_decoder_free in sframe_decode and _bfd_elf_merge_section_sframe. Passing the address of a local variable instead of the actual context address can lead to double frees if sfd_info->stf_ctx isn’t cleared. This patch ensures the correct context address is passed, preventing potential memory corruption.

In Details

This commit fixes an issue in the Binary File Descriptor (BFD) library related to sframe decoding. The sframe_decoder_free function was sometimes called with the address of a local variable sfd_ctx instead of the actual decoder context address sfd_info->sfd_ctx. This could lead to double frees if sfd_info->stf_ctx wasn't cleared. The patch corrects the calls in bfd/elf-sframe.c to prevent this issue.

For Context

The Binary File Descriptor (BFD) library is a part of binutils that allows programs to work with different object file formats in a uniform way. This commit fixes a bug related to memory management in the sframe decoder. The sframe_decoder_free function was being called incorrectly, which could lead to the same memory being freed twice, causing crashes or unpredictable behavior. The patch corrects how this function is called, preventing these issues.

Filed Under: bfdsframememorybugfix