diff options
author | 2005-02-22 16:09:28 +0000 | |
---|---|---|
committer | 2005-02-22 16:09:28 +0000 | |
commit | 50141f9ba2d317adc1fc12cee50ddbf1522d379e (patch) | |
tree | 766e78d1a2c316bbf24c72364747a8b7ef2c3441 /usr.bin/cvs/entries.c | |
parent | sort options; sync usage(); (diff) | |
download | wireguard-openbsd-50141f9ba2d317adc1fc12cee50ddbf1522d379e.tar.xz wireguard-openbsd-50141f9ba2d317adc1fc12cee50ddbf1522d379e.zip |
do not leak a file pointer in case of error
from Joris Vink
Diffstat (limited to 'usr.bin/cvs/entries.c')
-rw-r--r-- | usr.bin/cvs/entries.c | 5 |
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* |