Skip to content

Commit

Permalink
fix handler leak on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ljhcage authored and milianw committed Oct 21, 2024
1 parent 3a51c1a commit 958b134
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion launcher/ui/processlist_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ static inline ProcessInfo processInfo(DWORD processId)
pi.imageName = QString::fromUtf16(reinterpret_cast<const ushort *>(buffer));

HANDLE processTokenHandle = NULL;
if (!OpenProcessToken(handle, TOKEN_READ, &processTokenHandle) || !processTokenHandle)
if (!OpenProcessToken(handle, TOKEN_READ, &processTokenHandle) || !processTokenHandle) {
CloseHandle(handle);
return pi;
}

DWORD size = 0;
GetTokenInformation(processTokenHandle, TokenUser, NULL, 0, &size);
Expand Down

0 comments on commit 958b134

Please sign in to comment.