diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2007-10-08 14:13:14 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2007-10-08 14:13:14 +0000 |
commit | 0915f407809bdf13adb52d9e91b0454de8a97dc3 (patch) | |
tree | ed6b15e28d95fce328385352a1df58a664cdb8b7 /usr.bin/cvs/commit.c | |
parent | 48e3e91324da2fc6ca928fc1ef439473db18ef6f (diff) |
do not try to reset the default branch if the RCS file
does not exist, fixes a segfault when commiting a new file.
found by tobias@ who is going to make a nice little regression test for this.
Diffstat (limited to 'usr.bin/cvs/commit.c')
-rw-r--r-- | usr.bin/cvs/commit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c index 1a90b308ea3..1a8bc470599 100644 --- a/usr.bin/cvs/commit.c +++ b/usr.bin/cvs/commit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commit.c,v 1.114 2007/10/03 13:12:06 joris Exp $ */ +/* $OpenBSD: commit.c,v 1.115 2007/10/08 14:13:13 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> @@ -289,7 +289,7 @@ cvs_commit_local(struct cvs_file *cf) crev = NULL; rrev = NULL; - if (cf->file_rcs->rf_branch != NULL) { + if (cf->file_rcs != NULL && cf->file_rcs->rf_branch != NULL) { rcsnum_free(cf->file_rcs->rf_branch); cf->file_rcs->rf_branch = NULL; } |