Skip to content

Commit 958b134

Browse files
ljhcagemilianw
authored andcommittedOct 21, 2024
fix handler leak on windows
1 parent 3a51c1a commit 958b134

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎launcher/ui/processlist_win.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,10 @@ static inline ProcessInfo processInfo(DWORD processId)
9191
pi.imageName = QString::fromUtf16(reinterpret_cast<const ushort *>(buffer));
9292

9393
HANDLE processTokenHandle = NULL;
94-
if (!OpenProcessToken(handle, TOKEN_READ, &processTokenHandle) || !processTokenHandle)
94+
if (!OpenProcessToken(handle, TOKEN_READ, &processTokenHandle) || !processTokenHandle) {
95+
CloseHandle(handle);
9596
return pi;
97+
}
9698

9799
DWORD size = 0;
98100
GetTokenInformation(processTokenHandle, TokenUser, NULL, 0, &size);

0 commit comments

Comments
 (0)