diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2005-12-12 21:30:34 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2005-12-12 21:30:34 +0000 |
commit | 68ed363a0b9c63717b1200b9e04c8e1ff12f1f9d (patch) | |
tree | 8bb453598dd4be0e7a113ba5e95a81a03eb63d84 | |
parent | 262b2492af684520c52e6d5a9dcae03c7700179f (diff) |
only xfree() cf->cf_dir when it's not NULL;
-rw-r--r-- | usr.bin/cvs/file.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c index 231dde64606..440d82eba6f 100644 --- a/usr.bin/cvs/file.c +++ b/usr.bin/cvs/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.132 2005/12/10 20:27:45 joris Exp $ */ +/* $OpenBSD: file.c,v 1.133 2005/12/12 21:30:33 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -825,7 +825,9 @@ cvs_file_getdir(CVSFILE *cf, int flags, int (*cb)(CVSFILE *, void *), (cf->cf_dir != NULL) ? cf->cf_dir : ""); if (ret == -1 || ret >= (int)sizeof(fpath)) return (-1); - xfree(cf->cf_dir); + + if (cf->cf_dir != NULL) + xfree(cf->cf_dir); cf->cf_dir = xstrdup(fpath); } |