4 months ago
65a4a6fCodex/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