diff options
author | imp <imp@FreeBSD.org> | 2006-10-24 07:12:31 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2006-10-24 07:12:31 +0000 |
commit | b55d55f173b0a5193f8bf205d9219eaca1b66373 (patch) | |
tree | 03ccac84735d5564f03d26608a460f6e71a16ff3 /usr.sbin/config/mkmakefile.c | |
parent | 4a849e1038ae978e444cecdff690d4aba5f4b050 (diff) | |
download | FreeBSD-src-b55d55f173b0a5193f8bf205d9219eaca1b66373.zip FreeBSD-src-b55d55f173b0a5193f8bf205d9219eaca1b66373.tar.gz |
Don't leak files.
This also eliminates the need for ifp init.
Submitted by: ru@
Diffstat (limited to 'usr.sbin/config/mkmakefile.c')
-rw-r--r-- | usr.sbin/config/mkmakefile.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c index 62603d5..9e7ef60 100644 --- a/usr.sbin/config/mkmakefile.c +++ b/usr.sbin/config/mkmakefile.c @@ -182,7 +182,7 @@ makefile(void) void makehints(void) { - FILE *ifp = NULL, *ofp; + FILE *ifp, *ofp; char line[BUFSIZ]; char *s; struct hint *hint; @@ -228,10 +228,9 @@ makehints(void) continue; fprintf(ofp, "\"%s\\0\"\n", line); } + fclose(ifp); } fprintf(ofp, "\"\\0\"\n};\n"); - if (ifp) - fclose(ifp); fclose(ofp); moveifchanged(path("hints.c.new"), path("hints.c")); } |