summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJean-Francois Brousseau <jfb@cvs.openbsd.org>2005-02-22 16:09:29 +0000
committerJean-Francois Brousseau <jfb@cvs.openbsd.org>2005-02-22 16:09:29 +0000
commit4c7198502db14148b30033d3365dea9d553efbbc (patch)
treeca51957f7c592ef125ff50d0e72af7442c328836 /usr.bin
parent570addb2438facebba733506a5d8a241c1bdfe5e (diff)
do not leak a file pointer in case of error
from Joris Vink
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/entries.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c
index aee49b359bf..254a140648d 100644
--- a/usr.bin/cvs/entries.c
+++ b/usr.bin/cvs/entries.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: entries.c,v 1.24 2005/02/01 18:51:04 jfb Exp $ */
+/* $OpenBSD: entries.c,v 1.25 2005/02/22 16:09:28 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -122,6 +122,7 @@ cvs_ent_open(const char *dir, int flags)
}
if (ferror(fp)) {
cvs_log(LP_ERRNO, "read error on %s", entpath);
+ (void)fclose(fp);
cvs_ent_close(ep);
return (NULL);
}
@@ -304,7 +305,7 @@ cvs_ent_next(CVSENTRIES *ef)
/*
* cvs_ent_parse()
*
- * Parse a single line from a CVS/Entries file and return a cvs_entry structure
+ * Parse a single line from a CVS/Entries file and return a cvs_ent structure
* containing all the parsed information.
*/
struct cvs_ent*