Close files after opening them to avoiding leaking descriptors and memory.
This commit is contained in:
parent
bf822712f7
commit
aa8e31e68c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=115601
@ -258,8 +258,10 @@ main(int argc, char **argv)
|
||||
f = fopen(cfilename, "r");
|
||||
if (f == NULL)
|
||||
perror(cfilename);
|
||||
else
|
||||
else {
|
||||
process(f);
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cfilename = "stdin";
|
||||
|
Loading…
Reference in New Issue
Block a user