[PATCH 2/3] x86/disasm: avoid potentially leaking annotation buffers
Project / Subsystem
binutils / x86/disasm
Date
2026-05-15
Proposer
Jan Beulich <jbeulich@suse.com>
Source type
public_inbox
Consensus
Proposed
Sentiment
—/10
Technical tradeoffs
- • The fix has no significant performance impact.
- • It slightly increases code size due to the unconditional `free` call, but the effect is negligible.
All attributes
- project
- binutils
- subsystem
- x86/disasm
- patch_id
- —
- discussion_id
- 0568e50d-eaa0-4875-8fff-e44ed2e54341@suse.com
- source_type
- public_inbox
- title
- [PATCH 2/3] x86/disasm: avoid potentially leaking annotation buffers
- headline
- x86/disasm: Avoid potentially leaking annotation buffers
- tldr
- Fixes a potential memory leak in the x86 disassembler by ensuring annotation buffers are always freed.
- proposer
- Jan Beulich <jbeulich@suse.com>
- consensus
- Proposed
- outcome
- proposed
- sentiment_score
- —
- technical_tradeoffs
-
- • The fix has no significant performance impact.
- • It slightly increases code size due to the unconditional `free` call, but the effect is negligible.
- series_id
- binutils:x86/disasm: avoid potentially leaking annotation buffers
- series_role
- reply
- series_parts
- []
- tags
-
- • x86
- • disassembler
- • memory leak
- • bugfix
- bugzilla_url
- —
- date
- 2026-05-15T00:00:00.000Z
[PATCH 2/3] x86/disasm: avoid potentially leaking annotation buffers
This patch addresses a potential memory leak in the x86 disassembler. The asprintf function can return 0 while still allocating memory, leading to a leak if the free function is only called when asprintf succeeds. The patch moves the free call outside the if statement to ensure the buffer is always freed.