https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107560
kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2023-03-24 CC| |kargl at gcc dot gnu.org Status|UNCONFIRMED |NEW --- Comment #2 from kargl at gcc dot gnu.org --- (In reply to anlauf from comment #1) > This used to fail, but appears to have been fixed in the meantime. > A possible candidate for variant z2.f90 seems the fix for pr103413. > > While looking at valgrind output with current trunk, I see a memleak > for the BOZ case that is obviously plugged by: > > diff --git a/gcc/fortran/expr.cc b/gcc/fortran/expr.cc > index 4662328bf31..7fb33f81788 100644 > --- a/gcc/fortran/expr.cc > +++ b/gcc/fortran/expr.cc > @@ -466,6 +466,10 @@ free_expr0 (gfc_expr *e) > mpc_clear (e->value.complex); > break; > > + case BT_BOZ: > + free (e->boz.str); > + break; > + > default: > break; > } > > This might have been overseen during the BOZ rework. > Regtesting ... Yep. It was missed by the guy that did the BOZ rework. ;-) If it passed regtesting, it's ok to commit.