[CSRSRV] CsrGetProcessLuid(): Check 1st NtQueryInformationToken() result too (#2857)

Detected by Cppcheck: redundantAssignment.
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
This commit is contained in:
Serge Gautherie 2020-05-25 23:52:35 +02:00 committed by GitHub
parent d59d74fb69
commit 8fde48b5d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -873,6 +873,12 @@ CsrGetProcessLuid(IN HANDLE hProcess OPTIONAL,
NULL,
0,
&Length);
if (Status != STATUS_BUFFER_TOO_SMALL)
{
/* Close the token and fail */
NtClose(hToken);
return Status;
}
/* Allocate memory for the Token Info */
if (!(TokenStats = RtlAllocateHeap(CsrHeap, 0, Length)))