fix nt_terminate_process missing CloseHandle (#8294)

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2024-06-08 21:15:01 +08:00 committed by GitHub
parent be16f1be44
commit ffac670f95
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2503,8 +2503,10 @@ fn nt_terminate_process(process_id: DWORD) -> ResultType<()> {
if !h_token.is_null() {
if f_nt_terminate_process(h_token, 1) == 0 {
log::info!("terminate process {} success", process_id);
CloseHandle(h_token);
return Ok(());
} else {
CloseHandle(h_token);
bail!("NtTerminateProcess {} failed", process_id);
}
} else {