Landing: 9d1efc0b1c1d

Project / Subsystem

binutils / risc-v

Date

2026-07-09

Author

Nelson Chu <nelsonc1225@sourceware.org>

Commit

9d1efc0b1c1dab6a431482d3c795a67466c838b9

Source

public_inbox

Perf win

No

Breaking

No

All attributes

project
binutils
subsystem
risc-v
patch_id
commit_hash
9d1efc0b1c1dab6a431482d3c795a67466c838b9
source_type
public_inbox
headline
RISC-V: Fix memory leaks in arch attribute merging
tldr
Resolves memory leaks in the RISC-V linker's arch attribute merging logic, preventing resource exhaustion.
author
Nelson Chu <nelsonc1225@sourceware.org>
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • RISC-V
  • linker
  • memory leak
  • bugfix
discussion_id_link
bugzilla_pr
date
2026-07-09T00:00:00.000Z

The RISC-V linker’s architecture attribute merging function (riscv_merge_arch_attr_info) previously leaked memory on error paths. Subset lists (in_subsets, out_subsets, merged_subsets) were not released when the function exited prematurely due to parsing errors. This commit introduces a unified cleanup path to ensure all allocated subset nodes are freed, preventing both memory leaks and the carry-over of stale data into subsequent merge operations.