Memory leak reading from file