Signed-off-by: Serge Gautherie winehq-git_serge_180711@gautherie.fr --- programs/winetest/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/programs/winetest/main.c b/programs/winetest/main.c index 1731850..df1b371 100644 --- a/programs/winetest/main.c +++ b/programs/winetest/main.c @@ -232,8 +232,12 @@ static int running_as_admin (void) }
/* Get the group info from the token */ - groups_size = 0; - GetTokenInformation(token, TokenGroups, NULL, 0, &groups_size); + if (GetTokenInformation(token, TokenGroups, NULL, 0, &groups_size) || + GetLastError() != ERROR_INSUFFICIENT_BUFFER) + { + FreeSid(administrators); + return -1; + } groups = heap_alloc(groups_size); if (groups == NULL) {