Landing: e002a4e17481

Project / Subsystem

gcc / fortran

Date

2026-06-14

Author

Jerry DeLisle

Commit

e002a4e17481c1a083e2b49374565dbb2621aef8

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
fortran
patch_id
commit_hash
e002a4e17481c1a083e2b49374565dbb2621aef8
source_type
github
headline
Fortran fixes double free in ASSOCIATE with allocatable character functions
tldr
GCC Fortran now prevents double-free errors when an `ASSOCIATE` construct uses an allocatable, deferred-length character function as a selector by restricting…
author
Jerry DeLisle
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • fortran
  • bugfix
  • memory_management
discussion_id_link
bugzilla_pr
date
2026-06-14T00:00:00.000Z

This commit fixes a double-free bug in the GCC Fortran compiler when an ASSOCIATE construct’s selector is an allocatable, deferred-length character function. Previously, an extra free operation was unconditionally applied, but this is only necessary for POINTER-valued character functions. The fix ensures that the extra free is only performed when a POINTER is involved, preventing memory corruption, as allocatable function results are already released by their own cleanup routines.