Commit 007833f1 authored by Christoph von Wittich's avatar Christoph von Wittich Committed by Alexandre Julliard

msi: Fix process token leak.

parent 0acfe688
...@@ -478,13 +478,17 @@ static UINT get_user_sid(LPWSTR *usersid) ...@@ -478,13 +478,17 @@ static UINT get_user_sid(LPWSTR *usersid)
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
size = sizeof(buf); 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; return ERROR_FUNCTION_FAILED;
}
user = (PTOKEN_USER)buf; user = (PTOKEN_USER)buf;
if (!ConvertSidToStringSidW(user->User.Sid, usersid)) if (!ConvertSidToStringSidW(user->User.Sid, usersid)) {
CloseHandle(token);
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
}
CloseHandle(token);
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment