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

This commit is contained in:
Timo Kreuzer
2024-05-23 21:21:35 +02:00
parent da64119fe6
commit 4fb2fdbac6
+1 -1
View File
@@ -1953,6 +1953,7 @@ NtUnloadKey2(IN POBJECT_ATTRIBUTES TargetKey,
_SEH2_END;
}
Quit:
/* If CmUnloadKey() failed we need to unlock registry ourselves */
if (!NT_SUCCESS(Status))
{
@@ -1969,7 +1970,6 @@ NtUnloadKey2(IN POBJECT_ATTRIBUTES TargetKey,
CmpUnlockRegistry();
}
Quit:
/* Dereference the key */
ObDereferenceObject(KeyBody);