Possible soundness issue in JobPort::Drop
While conducting an internal unsafe review, we identified a possible soundness issue in JobPort::Drop
https://github.com/watchexec/command-group/blob/b88296fed10b18aebb7ad5889dab5e43b621297f/src/winres.rs#L35
This is highly suspect when combined with #[derive(Clone)] on the struct: any use of Clone is likely to lead to a double-free. This will usually produce a harmless "invalid handle" error which this code will silently ignore, but if either HANDLE value is reused by the kernel before the second clone is dropped, undefined behavior seems possible.
Huh, yeah, that does look likely. Unfortunately very busy elsewhere currently but if you want to submit a PR to clear that I'll merge and release asap.