diff --git a/reactos/ntoskrnl/se/access.c b/reactos/ntoskrnl/se/access.c index 05eee94990b..cc87da8160c 100644 --- a/reactos/ntoskrnl/se/access.c +++ b/reactos/ntoskrnl/se/access.c @@ -338,12 +338,14 @@ SeUnlockSubjectContext(IN PSECURITY_SUBJECT_CONTEXT SubjectContext) PrimaryToken = SubjectContext->PrimaryToken; ClientToken = SubjectContext->ClientToken; + /* Unlock the impersonation one if it's there */ + if (ClientToken) + { + SepReleaseTokenLock(ClientToken); + } + /* Always unlock the primary one */ SepReleaseTokenLock(PrimaryToken); - - /* Unlock the impersonation one if it's there */ - if (!ClientToken) return; - SepReleaseTokenLock(ClientToken); } /*