summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 4cb1d45dc7..5dafc0320f 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -780,14 +780,12 @@ rb_w32_pipe_exec(const char *cmd, const char *prog, int mode, int *pipe)
/* associate handle to file descritor */
*pipe = rb_w32_open_osfhandle((long)hDupFile, pipemode);
+ CloseHandle(hOrg);
if (*pipe == -1) {
- CloseHandle(hOrg);
CloseHandle(hDupFile);
CloseChildHandle(child);
break;
}
- if (!(reading && writing))
- CloseHandle(hOrg);
ret = child->pid;
} while (0));