Author: akhaldi
Date: Thu Jun 26 19:35:48 2014
New Revision: 63647
URL:
http://svn.reactos.org/svn/reactos?rev=63647&view=rev
Log:
[NTOS:CM]
* Plug some leaks. Inspired by CID 1206912 and fixed by Timo.
CORE-7975
Modified:
trunk/reactos/ntoskrnl/config/cmsysini.c
Modified: trunk/reactos/ntoskrnl/config/cmsysini.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmsysini.c…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmsysini.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmsysini.c [iso-8859-1] Thu Jun 26 19:35:48 2014
@@ -1052,7 +1052,11 @@
NULL,
0,
&KeyName);
- if (!Kcb) return FALSE;
+ if (!Kcb)
+ {
+ ObDereferenceObject(RootKey);
+ return FALSE;
+ }
/* Initialize the object */
RootKey->KeyControlBlock = Kcb;
@@ -1070,7 +1074,11 @@
0,
NULL,
&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 */
Status = ObReferenceObjectByHandle(CmpRegistryRootHandle,
@@ -1079,7 +1087,11 @@
KernelMode,
(PVOID*)&RootKey,
NULL);
- if (!NT_SUCCESS(Status)) return FALSE;
+ if (!NT_SUCCESS(Status))
+ {
+ ObDereferenceObject(RootKey);
+ return FALSE;
+ }
/* Completely sucessful */
return TRUE;