diff --git a/subsystems/win32/csrsrv/procsup.c b/subsystems/win32/csrsrv/procsup.c index 30cde8a2fea..de9743cd6c2 100644 --- a/subsystems/win32/csrsrv/procsup.c +++ b/subsystems/win32/csrsrv/procsup.c @@ -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)))