diff --git a/reactos/subsys/win32k/misc/object.c b/reactos/subsys/win32k/misc/object.c index 28b04eb9936..d93175d4b51 100644 --- a/reactos/subsys/win32k/misc/object.c +++ b/reactos/subsys/win32k/misc/object.c @@ -461,6 +461,7 @@ ObmReferenceObjectByHandle(PUSER_HANDLE_TABLE HandleTable, if ((ObjectType != otUnknown) && (ObjectHeader->Type != ObjectType)) { DPRINT1("Object type mismatch 0x%x 0x%x\n", ObjectType, ObjectHeader->Type); + ObmDereferenceObject(ObjectBody); return STATUS_UNSUCCESSFUL; }