Author: fireball
Date: Mon Dec 22 07:35:08 2008
New Revision: 38269
URL:
http://svn.reactos.org/svn/reactos?rev=38269&view=rev
Log:
- Fix KCB ref leaks in Cm parse routine (thanks Stefan).
Modified:
trunk/reactos/ntoskrnl/config/cmparse.c
Modified: trunk/reactos/ntoskrnl/config/cmparse.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmparse.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmparse.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmparse.c [iso-8859-1] Mon Dec 22 07:35:08 2008
@@ -977,7 +977,13 @@
/* Return hive and cell data */
*Hive = (*Kcb)->KeyHive;
*Cell = (*Kcb)->KeyCell;
-
+
+ /* Make sure it's not a dead KCB */
+ ASSERT((*Kcb)->RefCount > 0);
+
+ /* Reference it */
+ (VOID)CmpReferenceKeyControlBlock(*Kcb);
+
/* Return success for now */
return STATUS_SUCCESS;
}
@@ -1197,7 +1203,7 @@
if (!Kcb) ASSERT(FALSE);
/* Dereference the parent and set the new one */
- //CmpDereferenceKeyControlBlock(ParentKcb);
+ CmpDereferenceKeyControlBlock(ParentKcb);
ParentKcb = Kcb;
}
else
@@ -1336,7 +1342,7 @@
/* Dereference the parent if it exists */
Quickie:
- //if (ParentKcb) CmpDereferenceKeyControlBlock(ParentKcb);
+ if (ParentKcb) CmpDereferenceKeyControlBlock(ParentKcb);
/* Unlock the registry */
CmpUnlockRegistry();