diff options
| author | NIIBE Yutaka <[email protected]> | 2026-01-07 03:52:27 +0100 |
|---|---|---|
| committer | NIIBE Yutaka <[email protected]> | 2026-01-07 03:52:27 +0100 |
| commit | 753f59cd2c7af7e2665729721728ce5f9f08013b (patch) | |
| tree | cf7b97c589fc2c0556a19414c9847f6a07b13a26 | |
| parent | Post release updates (diff) | |
| download | libgpg-error-753f59cd2c7af7e2665729721728ce5f9f08013b.tar.gz libgpg-error-753f59cd2c7af7e2665729721728ce5f9f08013b.zip | |
w32:spawn: Handle the case where ->hProcess has invalid handle.
* src/spawn-w32.c (_gpgrt_process_terminat): Care about the case
it's INVALID_HANDLE_VALUE.
--
Signed-off-by: NIIBE Yutaka <[email protected]>
| -rw-r--r-- | src/spawn-w32.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/spawn-w32.c b/src/spawn-w32.c index ecc9437..acc9b2c 100644 --- a/src/spawn-w32.c +++ b/src/spawn-w32.c @@ -1159,6 +1159,9 @@ _gpgrt_process_wait (gpgrt_process_t process, int hang) gpg_err_code_t _gpgrt_process_terminate (gpgrt_process_t process) { + if (process->hProcess == INVALID_HANDLE_VALUE) + return 0; + return process_kill (process, 1); } @@ -1183,7 +1186,8 @@ _gpgrt_process_release (gpgrt_process_t process) if (process->hd_err != INVALID_HANDLE_VALUE) CloseHandle (process->hd_err); - CloseHandle (process->hProcess); + if (process->hProcess != INVALID_HANDLE_VALUE) + CloseHandle (process->hProcess); xfree (process); } |
