[PATCH] ld/pdb: Avoid double-free on malformed symbol data

Project / Subsystem

binutils / ld/pdb

Date

2026-09-30

Proposer

Oleg Tolmatcev <oleg.tolmatcev@gmail.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

—/10

All attributes

project
binutils
subsystem
ld/pdb
patch_id
—
discussion_id
20260930193657.733-4-oleg.tolmatcev@gmail.com
source_type
public_inbox
title
[PATCH] ld/pdb: Avoid double-free on malformed symbol data
headline
ld/pdb: Avoid double-free on malformed symbol data
tldr
Fixes a double-free bug when handling malformed PDB symbol data.
proposer
Oleg Tolmatcev <oleg.tolmatcev@gmail.com>
consensus
Proposed
outcome
proposed
sentiment_score
—
technical_tradeoffs
[]
series_id
—
series_role
standalone
series_parts
[]
tags
  • • pdb
  • • linker
  • • memory management
  • • bugfix
  • • segfault
bugzilla_url
—
date
2026-09-30T00:00:00.000Z

[PATCH] ld/pdb: Avoid double-free on malformed symbol data

This patch prevents a double-free error that can occur when handling malformed symbol data within PDB files. When the handle_debugs_section function fails, it triggers cleanup that frees file arrays for all modules. Subsequently, the populate_module_stream function was also attempting to free the current module’s file array, leading to the double-free. This change removes the redundant free call in populate_module_stream, ensuring proper memory management.