file: free memory after opendir()