diff --git a/implant/sliver/ps/ps_windows.go b/implant/sliver/ps/ps_windows.go index 24c6968e1d..688fe05327 100644 --- a/implant/sliver/ps/ps_windows.go +++ b/implant/sliver/ps/ps_windows.go @@ -124,10 +124,14 @@ func getProcessOwner(pid uint32) (owner string, err error) { if err != nil { return } + defer syscall.CloseHandle(handle) + var token syscall.Token if err = syscall.OpenProcessToken(handle, syscall.TOKEN_QUERY, &token); err != nil { return } + defer token.Close() + tokenUser, err := getTokenOwner(token) if err != nil { return