diff options
| author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2026-07-05 08:24:29 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-07-05 09:12:10 -0700 |
| commit | 9184231173dea25e922a0ee6ced938c57bca37e5 (patch) | |
| tree | 67bb64de377a4c165ae6a325bf8c26b90fc8ca26 /gitweb/gitweb.css | |
| parent | e36cda7d7ab1cbd2a096913777d382182872c8db (diff) | |
mingw: make `exit_process()` own the process handle on all paths
After "mingw: kill child processes in a gentler way", the ownership of
the HANDLE passed to `exit_process()` and `terminate_process_tree()` is
inconsistent. `terminate_process_tree()` always closes the handle;
`exit_process()` closes it on success and on the terminate-tree
fallback, but leaks it on the early return where GetExitCodeProcess()
fails or reports the process is no longer STILL_ACTIVE.
`mingw_kill()` compensated by closing the handle on its own error path,
which is a double-close on every error path that does not hit that one
leaky branch -- the callee has already closed the handle by then.
Coverity flagged the resulting use-after-free as CID 1437238.
Pin down the invariant that `exit_process()` and
`terminate_process_tree()` own the handle from the call onward and close
it on every return path; with that, the bogus close in `mingw_kill()`
goes away.
Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb/gitweb.css')
0 files changed, 0 insertions, 0 deletions
