diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2010-07-16 21:47:03 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2010-07-16 21:47:03 +0000 |
commit | cf674661e0c3ed7a3acf4cbe01c553551ba3820f (patch) | |
tree | 86b78aca3a4d76af949cea35e6742bcdc54bb67c | |
parent | e5f57d0bf749571f0c1be797ee882214a84ce21f (diff) |
Close FILEs when fork fails.
OK nicm
-rw-r--r-- | usr.bin/diff/diffreg.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 443d1089430..8beed5500ad 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diffreg.c,v 1.78 2010/07/16 08:06:00 ray Exp $ */ +/* $OpenBSD: diffreg.c,v 1.79 2010/07/16 21:47:02 ray Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -382,7 +382,8 @@ diffreg(char *file1, char *file2, int flags) warnx("No more processes"); status |= 2; xfree(header); - return (D_ERROR); + rval = D_ERROR; + goto closem; case 0: /* child */ if (pfd[0] != STDIN_FILENO) { |