[NTOS:CM]

- Correctly delete resource in failure cases of CmpInitializeHive. Fixes pool corruption when trying to load an invalid hive file.

svn path=/trunk/; revision=63949
This commit is contained in:
Thomas Faber 2014-08-26 10:49:38 +00:00
parent 090134e9e6
commit 10e9fc81a1

View file

@ -201,6 +201,7 @@ CmpInitializeHive(OUT PCMHIVE *RegistryHive,
if (!NT_SUCCESS(Status))
{
/* Cleanup allocations and fail */
ExDeleteResourceLite(Hive->FlusherLock);
ExFreePoolWithTag(Hive->FlusherLock, TAG_CM);
ExFreePoolWithTag(Hive->ViewLock, TAG_CM);
ExFreePoolWithTag(Hive, TAG_CM);
@ -218,6 +219,7 @@ CmpInitializeHive(OUT PCMHIVE *RegistryHive,
if (CheckStatus != 0)
{
/* Cleanup allocations and fail */
ExDeleteResourceLite(Hive->FlusherLock);
ExFreePoolWithTag(Hive->FlusherLock, TAG_CM);
ExFreePoolWithTag(Hive->ViewLock, TAG_CM);
ExFreePoolWithTag(Hive, TAG_CM);