Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

fix(win-sandbox): close restricted token and job handles on spawn-setup failure

4 months ago

65a4a6f
Authored
Claude6/5/2026, 1:37:05 PM
Codex/Bugbot review (commit e338f16): the `?` early-returns after the restricted
token and Job Object were created leaked those kernel handles on each failed
spawn. CreateRestrictedToken, CreateJobObjectW, SetInformationJobObject, and
CreateProcessAsUserW failures now close the handles already created before
returning, mirroring the existing AssignProcessToJobObject cleanup path.

Windows-only crate (not built on the Linux test lane); syntax verified with
rustfmt and the cleanup mirrors the proven in-function pattern.

Parente338f16

1 file changed
  • crates/cowork-win-sandbox/src/main.rs+24−11