Why are you using exit(1)? If I'm not incorrect, it simply terminates right then and there, and doesn't clean up the stack or anything. This means your file object is leaking memory in case of failure.
If it doesn't affect stack objects in the nearest scope, then it definitely affects everything else.
On top of that, it's pointless. You can just throw a return in there, and the stack frame gets cleaned up properly.
I know it might be a big issue in this particular program, but seeing as you used it two times in this very small program, where you should/could have used return, it looks like you have a bad habit that you shouldn't be teaching others. No offense.