diff options
author | James Ross-Gowan <rossy@jrg.systems> | 2017-07-28 23:00:46 +1000 |
---|---|---|
committer | James Ross-Gowan <rossy@jrg.systems> | 2017-07-28 23:00:46 +1000 |
commit | 545360460625a9d4daa9040de8db852833b0793a (patch) | |
tree | 782e795c33b91a933ffb5976280227be9db8ce4f /osdep | |
parent | 345bb193fe75ddbf2f21bd295869276b6fa87189 (diff) |
subprocess-win: don't leak pipe handle on error
Diffstat (limited to 'osdep')
-rw-r--r-- | osdep/subprocess-win.c | 4 |
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: |