[NTOSKRNL]
authorEric Kohl <eric.kohl@reactos.org>
Sat, 10 Sep 2016 13:54:16 +0000 (13:54 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 10 Sep 2016 13:54:16 +0000 (13:54 +0000)
Fix lock/unlock order in SeLockSubjectContext/SeUnlockSubjectContext.
Patch by  Volodymyr Shcherbyna.
CORE-11966 #resolve #comment Thanks a lot!

svn path=/trunk/; revision=72644

reactos/ntoskrnl/se/access.c

index 05eee94..cc87da8 100644 (file)
@@ -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);
 }
 
 /*