mirror of
https://github.com/reactos/reactos.git
synced 2025-04-29 10:39:07 +00:00
[NTOS:CM] Avoid unnecessary ObDereferenceObject when handling an ObInsertObject failure (#6673)
In case of failure, ObInsertObject itself dereferences the object, so calling ObDereferenceObject one more time in the failure handler is redundant. - Remove ObDereferenceObject call from CmpCreateRegistryRoot in case ObInsertObject fails. - Add missing RootKey dereference if CmpCreateRegistryRoot failed to get the key cell (KeyCell). CORE-17904
This commit is contained in:
parent
1cf8759d69
commit
fc6bf61e4c
1 changed files with 5 additions and 2 deletions
|
@ -1109,7 +1109,11 @@ CmpCreateRegistryRoot(VOID)
|
|||
/* Sanity check, and get the key cell */
|
||||
ASSERT((&CmiVolatileHive->Hive)->ReleaseCellRoutine == NULL);
|
||||
KeyCell = (PCM_KEY_NODE)HvGetCell(&CmiVolatileHive->Hive, RootIndex);
|
||||
if (!KeyCell) return FALSE;
|
||||
if (!KeyCell)
|
||||
{
|
||||
ObDereferenceObject(RootKey);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Create the KCB */
|
||||
RtlInitUnicodeString(&KeyName, L"\\REGISTRY");
|
||||
|
@ -1144,7 +1148,6 @@ CmpCreateRegistryRoot(VOID)
|
|||
&CmpRegistryRootHandle);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
ObDereferenceObject(RootKey);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue