That should not be his solution. He should fix the problem.
And I thought that fopen() calling malloc() was a definite; what brings doubts? It is returning a FILE*, so obviously, it cannot return a local variable, rather it allocates the memory on the heap, using, of course, malloc().