diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/rcs/ci.c | 5 | ||||
-rw-r--r-- | usr.bin/rcs/diff3.c | 13 | ||||
-rw-r--r-- | usr.bin/rcs/rcs.c | 5 |
3 files changed, 15 insertions, 8 deletions
diff --git a/usr.bin/rcs/ci.c b/usr.bin/rcs/ci.c index e7c2ad10fad..20c1bf6debb 100644 --- a/usr.bin/rcs/ci.c +++ b/usr.bin/rcs/ci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ci.c,v 1.169 2006/05/05 01:29:59 ray Exp $ */ +/* $OpenBSD: ci.c,v 1.170 2006/05/08 16:56:40 xsa Exp $ */ /* * Copyright (c) 2005, 2006 Niall O'Higgins <niallo@openbsd.org> * All rights reserved. @@ -365,7 +365,8 @@ checkin_diff_file(struct checkin_params *pb) b2 = NULL; diff_format = D_RCSDIFF; - rcs_diffreg(path1, path2, b3); + if (rcs_diffreg(path1, path2, b3) == D_ERROR) + goto out; rcs_buf_putc(b3, '\0'); deltatext = (char *)rcs_buf_release(b3); diff --git a/usr.bin/rcs/diff3.c b/usr.bin/rcs/diff3.c index 271ae8fcf0a..745694c7ba3 100644 --- a/usr.bin/rcs/diff3.c +++ b/usr.bin/rcs/diff3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff3.c,v 1.6 2006/05/08 10:19:34 xsa Exp $ */ +/* $OpenBSD: diff3.c,v 1.7 2006/05/08 16:56:40 xsa Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -72,7 +72,7 @@ static const char copyright[] = #ifndef lint static const char rcsid[] = - "$OpenBSD: diff3.c,v 1.6 2006/05/08 10:19:34 xsa Exp $"; + "$OpenBSD: diff3.c,v 1.7 2006/05/08 16:56:40 xsa Exp $"; #endif /* not lint */ #include "includes.h" @@ -163,6 +163,7 @@ rcs_diff3(RCSFILE *rf, char *workfile, RCSNUM *rev1, RCSNUM *rev2, int verbose) BUF *b1, *b2, *b3, *d1, *d2, *diffb; b1 = b2 = b3 = d1 = d2 = diffb = NULL; + dp13 = dp23 = path1 = path2 = path3 = NULL; rcsnum_tostr(rev1, r1, sizeof(r1)); rcsnum_tostr(rev2, r2, sizeof(r2)); @@ -195,8 +196,12 @@ rcs_diff3(RCSFILE *rf, char *workfile, RCSNUM *rev1, RCSNUM *rev2, int verbose) rcs_buf_free(b2); b2 = NULL; - rcs_diffreg(path1, path3, d1); - rcs_diffreg(path2, path3, d2); + if ((rcs_diffreg(path1, path3, d1) == D_ERROR) || + (rcs_diffreg(path2, path3, d2) == D_ERROR)) { + rcs_buf_free(diffb); + diffb = NULL; + goto out; + } (void)xasprintf(&dp13, "%s/d13.XXXXXXXXXX", rcs_tmpdir); rcs_buf_write_stmp(d1, dp13, 0600); diff --git a/usr.bin/rcs/rcs.c b/usr.bin/rcs/rcs.c index 74c8fecfe6d..4b742e91a94 100644 --- a/usr.bin/rcs/rcs.c +++ b/usr.bin/rcs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.7 2006/05/04 07:06:58 xsa Exp $ */ +/* $OpenBSD: rcs.c,v 1.8 2006/05/08 16:56:40 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -1390,7 +1390,8 @@ rcs_rev_remove(RCSFILE *rf, RCSNUM *rev) rcs_buf_free(prevbuf); diff_format = D_RCSDIFF; - rcs_diffreg(path_tmp1, path_tmp2, newdiff); + if (rcs_diffreg(path_tmp1, path_tmp2, newdiff) == D_ERROR) + errx(1, "rcs_diffreg failed"); newdeltatext = rcs_buf_release(newdiff); } else if (nextrdp == NULL && prevrdp != NULL) { |