http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47637
janus at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2011.02.08 20:14:11 CC| |janus at gcc dot gnu.org Summary|Memory leak involving |[OOP] Memory leak involving |derived types w/ |INTENT(OUT) CLASS argument |allocatable components |w/ allocatable components Ever Confirmed|0 |1 --- Comment #1 from janus at gcc dot gnu.org 2011-02-08 20:14:11 UTC --- Confirmed. Here is a shorter example with the same symptoms: program leaky type :: t integer, allocatable :: i(:) end type type(t) :: a call init(a) call init(a) contains subroutine init(x) class(t), intent(out) :: x allocate(x%i(1000)) end subroutine end program Note that the memory leak only occurs with a CLASS argument, not with TYPE. Also the auto-dealloc at the end of the main program works correctly, so that we only lose one of the two allocations.