From db3a6b89fe3cbba095f641da4762761955259a8c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Wed, 15 Jul 1998 16:44:19 +0200
Subject: [PATCH] More paranoia.

Rev: src/modules/files/file.c:1.111
---
 src/modules/files/file.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/modules/files/file.c b/src/modules/files/file.c
index b67696c0ad..e410e43126 100644
--- a/src/modules/files/file.c
+++ b/src/modules/files/file.c
@@ -5,7 +5,7 @@
 \*/
 
 #include "global.h"
-RCSID("$Id: file.c,v 1.110 1998/07/12 21:18:35 grubba Exp $");
+RCSID("$Id: file.c,v 1.111 1998/07/15 14:44:19 grubba Exp $");
 #include "fdlib.h"
 #include "interpret.h"
 #include "svalue.h"
@@ -1502,8 +1502,16 @@ static void file_pipe(INT32 args)
     error("Cannot create a pipe matching those parameters.\n");
   }while(0);
     
-  if(i<0)
+  if ((i<0) || (inout[0] < 0) || (inout[1] < 0))
   {
+    if (i >= 0) {
+      if (inout[0] >= 0) {
+	close(inout[0]);
+      }
+      if (inout[1] >= 0) {
+	close(inout[1]);
+      }
+    }
     ERRNO=errno;
     push_int(0);
   }
-- 
GitLab