It is generally considered a bad idea to dereference an object after the reference...
[reactos.git] / reactos / ntoskrnl / ps / query.c
index 3e0b252..c42ee05 100644 (file)
@@ -1233,9 +1233,9 @@ NtSetInformationThread (IN HANDLE ThreadHandle,
             /* Shoult never occure if the data table is correct */
             KEBUGCHECK(0);
         }
+       ObDereferenceObject (Thread);
      }
-  ObDereferenceObject (Thread);
-
+  
   return Status;
 }