about summary refs log tree commit diff
path: root/Src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/utils.c b/Src/utils.c
index ad4ffca92..a12914787 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -1631,7 +1631,8 @@ movefd(int fd)
 #else
 	int fe = movefd(dup(fd));
 #endif
-	zclose(fd);
+	if (fe != -1)
+	    zclose(fd);
 	fd = fe;
     }
     if(fd != -1) {