Separate process waiting from process-reference release to eliminate Windows HANDLE reuse race
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run

This commit is contained in:
Andrea Mazzoleni 2026-09-04 13:16:55 +02:00
parent 5381d0a1ee
commit 11fee73ec4
4 changed files with 36 additions and 12 deletions

View file

@ -337,7 +337,9 @@ static int windows_ps(const char* ps_command, char* out, size_t out_size)
close(stdout_fd);
status = 0;
if (os_wait(pid, &status) < 0) {
pid_t pid_ret = os_wait(pid, &status);
os_dispose(pid);
if (pid_ret < 0) {
log_error(errno, "Failed to wait for PowerShell command '%s' (from os_wait).\n", ps_command);
return -1;
}