summaryrefslogtreecommitdiffstats
path: root/osdep/subprocess-win.c
diff options
context:
space:
mode:
Diffstat (limited to 'osdep/subprocess-win.c')
-rw-r--r--osdep/subprocess-win.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/osdep/subprocess-win.c b/osdep/subprocess-win.c
index b94be1a5ef..c662fb6301 100644
--- a/osdep/subprocess-win.c
+++ b/osdep/subprocess-win.c
@@ -126,8 +126,10 @@ static int create_overlapped_pipe(HANDLE *read, HANDLE *write)
// Open the write end of the pipe as a synchronous handle
*write = CreateFileW(buf, GENERIC_WRITE, 0, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
- if (*write == INVALID_HANDLE_VALUE)
+ if (*write == INVALID_HANDLE_VALUE) {
+ CloseHandle(*read);
goto error;
+ }
return 0;
error: