Clearing static allocations in readdir