https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121972
--- Comment #13 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jerry DeLisle <[email protected]>: https://gcc.gnu.org/g:1a2de01fbac64f97fed6f63ff655b13bff831877 commit r17-2028-g1a2de01fbac64f97fed6f63ff655b13bff831877 Author: Paul Thomas <[email protected]> Date: Tue Jun 30 10:39:57 2026 +0100 Fortran: Fix memory leak found in pdt_86.f03 [PR121972] Followup on memory leaks found using -fsanitize=address in existing test cases. Co-authored-by: Jerry DeLisle <[email protected]> PR fortran/121972 gcc/fortran/ * decl.cc (gfc_get_pdt_instance): A PDT that has a derived type component, which has allocatable components, must be marked as having allocatable components. * resolve.cc (gfc_resolve_ref): Initialize last_pdt from the base symbol's declared type when the expression type is not a PDT. gcc/testsuite/ * gfortran.dg/pdt_86.f03: Add tree dump for counts of frees and mallocs (41 & 31 respectively). * gfortran.dg/pdt_86_reduced.f90: New test to check that the non-PDT version of the leak has gone.
