diff options
author | 2005-06-09 01:45:45 +0000 | |
---|---|---|
committer | 2005-06-09 01:45:45 +0000 | |
commit | 0a9c8a904a4be06f60af8b225d14cecb4a9ee6ae (patch) | |
tree | 86c38acb260017bb743b10e62196b26e90e3dc4a /usr.bin/cvs/file.c | |
parent | remove useless cvsd leftovers. (diff) | |
download | wireguard-openbsd-0a9c8a904a4be06f60af8b225d14cecb4a9ee6ae.tar.xz wireguard-openbsd-0a9c8a904a4be06f60af8b225d14cecb4a9ee6ae.zip |
don't forget to close entfile in cvs_file_getspec().
Diffstat (limited to 'usr.bin/cvs/file.c')
-rw-r--r-- | usr.bin/cvs/file.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c index a701b64da37..44d831ae5bb 100644 --- a/usr.bin/cvs/file.c +++ b/usr.bin/cvs/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.86 2005/06/01 16:49:20 joris Exp $ */ +/* $OpenBSD: file.c,v 1.87 2005/06/09 01:45:45 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -415,11 +415,12 @@ cvs_file_getspec(char **fspec, int fsn, int flags, int (*cb)(CVSFILE *, void *), CVSENTRIES *entfile; struct cvs_ent *ent; - entfile = cvs_ent_open(".", O_RDONLY); base = cvs_file_lget(".", 0, NULL, NULL); if (base == NULL) return (NULL); + entfile = cvs_ent_open(".", O_RDONLY); + /* * fill in the repository base (needed to construct repo's in * cvs_file_create). @@ -439,6 +440,8 @@ cvs_file_getspec(char **fspec, int fsn, int flags, int (*cb)(CVSFILE *, void *), if (cb != NULL) { if (cb(base, arg) != CVS_EX_OK) { cvs_file_free(base); + if (entfile) + cvs_ent_close(entfile); return (NULL); } } @@ -464,11 +467,15 @@ cvs_file_getspec(char **fspec, int fsn, int flags, int (*cb)(CVSFILE *, void *), nf = cvs_file_lget(pcopy, 0, base, ent); if (nf == NULL) { cvs_file_free(base); + if (entfile) + cvs_ent_close(entfile); return (NULL); } if (cvs_file_attach(base, nf) < 0) { cvs_file_free(base); + if (entfile) + cvs_ent_close(entfile); return (NULL); } } @@ -480,18 +487,25 @@ cvs_file_getspec(char **fspec, int fsn, int flags, int (*cb)(CVSFILE *, void *), if (cvs_file_getdir(nf, flags, np, cb, arg) < 0) { cvs_file_free(base); + if (entfile) + cvs_ent_close(entfile); return (NULL); } } else { if (cb != NULL) { if (cb(nf, arg) != CVS_EX_OK) { cvs_file_free(base); + if (entfile) + cvs_ent_close(entfile); return (NULL); } } } } + if (entfile) + cvs_ent_close(entfile); + return (base); } |