missing fclose when returning early
Merge pull request #1180 from nghiaho12:master