!! check whether memory leak is detected !! on pointer assignment from a function !! returning a pointer module m1 contains function f1() real, pointer :: f1(:) allocate(f1(5000000)) f1 = 1. end function end module program leak use m1 real, pointer :: pr(:) real a pr => f1() a = pr(1) nullify(pr) end