- Fix KCB ref leaks in Cm parse routine (thanks Stefan).

svn path=/trunk/; revision=38269
This commit is contained in:
Aleksey Bragin
2008-12-22 13:35:08 +00:00
parent fce144efaa
commit c8d9e123b7
+9 -3
View File
@@ -977,7 +977,13 @@ CmpBuildHashStackAndLookupCache(IN PCM_KEY_BODY ParseObject,
/* 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 @@ CmpParseKey(IN PVOID ParseObject,
if (!Kcb) ASSERT(FALSE);
/* Dereference the parent and set the new one */
//CmpDereferenceKeyControlBlock(ParentKcb);
CmpDereferenceKeyControlBlock(ParentKcb);
ParentKcb = Kcb;
}
else
@@ -1336,7 +1342,7 @@ CmpParseKey(IN PVOID ParseObject,
/* Dereference the parent if it exists */
Quickie:
//if (ParentKcb) CmpDereferenceKeyControlBlock(ParentKcb);
if (ParentKcb) CmpDereferenceKeyControlBlock(ParentKcb);
/* Unlock the registry */
CmpUnlockRegistry();