msi: Fix process token leak.
This commit is contained in:
parent
0acfe68864
commit
007833f130
|
@ -478,13 +478,17 @@ static UINT get_user_sid(LPWSTR *usersid)
|
|||
return ERROR_FUNCTION_FAILED;
|
||||
|
||||
size = sizeof(buf);
|
||||
if (!GetTokenInformation(token, TokenUser, (void *)buf, size, &size))
|
||||
if (!GetTokenInformation(token, TokenUser, (void *)buf, size, &size)) {
|
||||
CloseHandle(token);
|
||||
return ERROR_FUNCTION_FAILED;
|
||||
}
|
||||
|
||||
user = (PTOKEN_USER)buf;
|
||||
if (!ConvertSidToStringSidW(user->User.Sid, usersid))
|
||||
if (!ConvertSidToStringSidW(user->User.Sid, usersid)) {
|
||||
CloseHandle(token);
|
||||
return ERROR_FUNCTION_FAILED;
|
||||
|
||||
}
|
||||
CloseHandle(token);
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue