https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108923
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Mikael Morin <mik...@gcc.gnu.org>: https://gcc.gnu.org/g:5c638095e7e0fa4de4e4f7326384a86830b25732 commit r13-6346-g5c638095e7e0fa4de4e4f7326384a86830b25732 Author: Mikael Morin <mik...@gcc.gnu.org> Date: Sat Feb 25 21:37:46 2023 +0100 fortran: Reuse associated_dummy memory if previously allocated [PR108923] This avoids making the associted_dummy field point to a new memory chunk if it's already pointing somewhere, in which case doing so would leak the previously allocated chunk. PR fortran/108923 gcc/fortran/ChangeLog: * intrinsic.cc (get_intrinsic_dummy_arg, set_intrinsic_dummy_arg): Rename the former to the latter. Remove the return value, add a reference to the lhs as argument, and do the pointer assignment inside the function. Don't do it if the pointer is already non-NULL. (sort_actual): Update caller.