On Wed, Feb 05, 2014 at 12:56, Paul Winter wrote: > Hi list, > > I'm currently trying to get familiar with OpenBSD source code and I've > noticed > that there are fclose() function calls missing sometimes. (e.g. > usr.bin/awk/maketab.c, usr.sbin/smtpd/table_passwd.c). > > I'd like to ask whether these files are intended to be closed by operating > system when the utility exits or fclose() calls just has been forgotten. > > My personal view is that program should always call free, fclose and such > even when exiting immediately after. For purpose of clean and transparent > code and logic and for purpose of code reusability. But perhaps there are > some reasons not to do that I'm missing.
For functions other than main, I agree. In main it's just clutter.