From eb6d38a60968e1648ce9054921f4d9827d141ccb Mon Sep 17 00:00:00 2001 From: joris Date: Mon, 8 Oct 2007 14:13:13 +0000 Subject: 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. --- usr.bin/cvs/commit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/cvs/commit.c') 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 * Copyright (c) 2006 Xavier Santolaria @@ -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; } -- cgit v1.2.3-59-g8ed1b