From f481a8640d45dd79f39b2b2a8ac66821fdd88925 Mon Sep 17 00:00:00 2001 From: ray Date: Fri, 16 Jul 2010 21:47:02 +0000 Subject: [PATCH] Close FILEs when fork fails. OK nicm --- usr.bin/diff/diffreg.c | 5 +++-- 1 file 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) { -- 2.20.1