Fix uninitialized address freeing in case of error in MupGetProviderInformation(), InitializeProvider()
CID 1322227
CID 1322240

svn path=/trunk/; revision=68990
This commit is contained in:
Pierre Schweitzer 2015-09-04 13:58:44 +00:00
parent 414b2645fd
commit cf68c63f61

View file

@ -950,6 +950,10 @@ InitializeProvider(PCWSTR ProviderName,
Status = ZwQueryValueKey(KeyHandle, &Value, KeyValueFullInformation, Info, ResultLength, &ResultLength); Status = ZwQueryValueKey(KeyHandle, &Value, KeyValueFullInformation, Info, ResultLength, &ResultLength);
} }
else
{
Info = NULL;
}
ZwClose(KeyHandle); ZwClose(KeyHandle);
@ -959,6 +963,7 @@ InitializeProvider(PCWSTR ProviderName,
*/ */
if (NT_SUCCESS(Status)) if (NT_SUCCESS(Status))
{ {
ASSERT(Info != NULL);
AddUnregisteredProvider((PWSTR)((ULONG_PTR)Info + Info->DataOffset), ProviderOrder); AddUnregisteredProvider((PWSTR)((ULONG_PTR)Info + Info->DataOffset), ProviderOrder);
} }
@ -1006,11 +1011,17 @@ MupGetProviderInformation(VOID)
Status = ZwQueryValueKey(KeyHandle, &ProviderOrder, KeyValueFullInformation, Info, ResultLength, &ResultLength); Status = ZwQueryValueKey(KeyHandle, &ProviderOrder, KeyValueFullInformation, Info, ResultLength, &ResultLength);
} }
else
{
Info = NULL;
}
ZwClose(KeyHandle); ZwClose(KeyHandle);
if (NT_SUCCESS(Status)) if (NT_SUCCESS(Status))
{ {
ASSERT(Info != NULL);
Providers = (PWSTR)((ULONG_PTR)Info + Info->DataOffset); Providers = (PWSTR)((ULONG_PTR)Info + Info->DataOffset);
End = FALSE; End = FALSE;
ProviderCount = 0; ProviderCount = 0;