summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-12-07 18:14:05 +0000
committerJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-12-07 18:14:05 +0000
commit54ac7d7b30d42956da9aa94d141ce5cb0f0d427f (patch)
tree6bafc9f6d2adb28d8d14dc674994a764af9857d3 /usr.bin
parentabd2873ce5a8139287386ead50c057a11ee8015a (diff)
when loading directory info, only close the handle to the Entries file
if it is not NULL. fixes a crash when running commands that have no administrative files to open yet (i.e. import) noticed by and discussed with Joris Vink
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/file.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c
index fc6974ea9c5..198c13bb1be 100644
--- a/usr.bin/cvs/file.c
+++ b/usr.bin/cvs/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.39 2004/12/07 17:10:56 tedu Exp $ */
+/* $OpenBSD: file.c,v 1.40 2004/12/07 18:14:04 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -615,10 +615,10 @@ cvs_file_getdir(CVSFILE *cf, int flags)
}
} while (ret > 0);
-#if 1
- cvs_ent_close(cdp->cd_ent);
- cdp->cd_ent = NULL;
-#endif
+ if (cdp->cd_ent != NULL) {
+ cvs_ent_close(cdp->cd_ent);
+ cdp->cd_ent = NULL;
+ }
if (flags & CF_SORT) {
cvs_file_sort(&(cdp->cd_files), cdp->cd_nfiles);