https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116679
anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2024-09-20 Status|UNCONFIRMED |NEW --- Comment #2 from anlauf at gcc dot gnu.org --- Confirmed. The testcase in comment#1 needs fixing (remove 'use bugdemo'). The memleak there depends on array being a pointer. Changing it to allocatable seems to plug the leak here. Note that replacing in the block items = [wrapper(1)] by items(1)% val = 1 also does not leak.