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.

Thanks,
P. Winter

Reply via email to