Dereference the object if the type doesn't match in ObmReferenceObjectByHandle.
Modified: trunk/reactos/subsys/win32k/misc/object.c

Modified: trunk/reactos/subsys/win32k/misc/object.c
--- trunk/reactos/subsys/win32k/misc/object.c	2005-04-02 16:16:53 UTC (rev 14446)
+++ trunk/reactos/subsys/win32k/misc/object.c	2005-04-02 16:17:08 UTC (rev 14447)
@@ -461,6 +461,7 @@
   if ((ObjectType != otUnknown) && (ObjectHeader->Type != ObjectType))
     {
       DPRINT1("Object type mismatch 0x%x 0x%x\n", ObjectType, ObjectHeader->Type);
+      ObmDereferenceObject(ObjectBody);
       return STATUS_UNSUCCESSFUL;
     }