From 3cda26b52e9452d4c33f0af08f873804823cb823 Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Tue, 29 Mar 2005 17:37:38 +0000 Subject: cvs_file_attach() can fail, make sure we can handle it when it does. --- usr.bin/cvs/file.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'usr.bin/cvs/file.c') diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c index 3262a65171a..e5534670a6b 100644 --- a/usr.bin/cvs/file.c +++ b/usr.bin/cvs/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.58 2005/03/26 08:09:54 tedu Exp $ */ +/* $OpenBSD: file.c,v 1.59 2005/03/29 17:37:37 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -380,7 +380,10 @@ cvs_file_getspec(char **fspec, int fsn, int flags) return (NULL); } - cvs_file_attach(cf, nf); + if (cvs_file_attach(cf, nf) < 0) { + cvs_file_free(base); + return (NULL); + } } if (np != NULL) { -- cgit v1.2.3