https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90069
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Andre Vehreschild <ve...@gcc.gnu.org>: https://gcc.gnu.org/g:2f97d98d174e3ef9f3a9a83c179d787abde5e066 commit r15-891-g2f97d98d174e3ef9f3a9a83c179d787abde5e066 Author: Andre Vehreschild <ve...@gcc.gnu.org> Date: Wed Jul 12 16:52:15 2023 +0200 Fix memory leak. Prevent double call of function return class object and free the object after copy. gcc/fortran/ChangeLog: PR fortran/90069 * trans-expr.cc (gfc_conv_procedure_call): Evaluate expressions with side-effects only ones and ensure old is freeed. gcc/testsuite/ChangeLog: PR fortran/90069 * gfortran.dg/class_76.f90: New test.