mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 13:23:04 +00:00
[NTOS:CM]
* Plug some leaks. Inspired by CID 1206912 and fixed by Timo. CORE-7975 svn path=/trunk/; revision=63647
This commit is contained in:
parent
2925773710
commit
2c9a27ae40
1 changed files with 15 additions and 3 deletions
|
@ -1052,7 +1052,11 @@ CmpCreateRegistryRoot(VOID)
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
&KeyName);
|
&KeyName);
|
||||||
if (!Kcb) return FALSE;
|
if (!Kcb)
|
||||||
|
{
|
||||||
|
ObDereferenceObject(RootKey);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize the object */
|
/* Initialize the object */
|
||||||
RootKey->KeyControlBlock = Kcb;
|
RootKey->KeyControlBlock = Kcb;
|
||||||
|
@ -1070,7 +1074,11 @@ CmpCreateRegistryRoot(VOID)
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
&CmpRegistryRootHandle);
|
&CmpRegistryRootHandle);
|
||||||
if (!NT_SUCCESS(Status)) return FALSE;
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
ObDereferenceObject(RootKey);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Reference the key again so that we never lose it */
|
/* Reference the key again so that we never lose it */
|
||||||
Status = ObReferenceObjectByHandle(CmpRegistryRootHandle,
|
Status = ObReferenceObjectByHandle(CmpRegistryRootHandle,
|
||||||
|
@ -1079,7 +1087,11 @@ CmpCreateRegistryRoot(VOID)
|
||||||
KernelMode,
|
KernelMode,
|
||||||
(PVOID*)&RootKey,
|
(PVOID*)&RootKey,
|
||||||
NULL);
|
NULL);
|
||||||
if (!NT_SUCCESS(Status)) return FALSE;
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
ObDereferenceObject(RootKey);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Completely sucessful */
|
/* Completely sucessful */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue