[NTOS:CM] Properly unlock registry on failure in NtUnloadKey2

This commit is contained in:
Timo Kreuzer 2024-04-30 15:12:57 +03:00
parent da64119fe6
commit 4fb2fdbac6

View file

@ -1953,6 +1953,7 @@ NtUnloadKey2(IN POBJECT_ATTRIBUTES TargetKey,
_SEH2_END; _SEH2_END;
} }
Quit:
/* If CmUnloadKey() failed we need to unlock registry ourselves */ /* If CmUnloadKey() failed we need to unlock registry ourselves */
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
@ -1969,7 +1970,6 @@ NtUnloadKey2(IN POBJECT_ATTRIBUTES TargetKey,
CmpUnlockRegistry(); CmpUnlockRegistry();
} }
Quit:
/* Dereference the key */ /* Dereference the key */
ObDereferenceObject(KeyBody); ObDereferenceObject(KeyBody);