mirror of
https://github.com/reactos/reactos.git
synced 2025-06-12 09:08:31 +00:00
[MUP]
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:
parent
414b2645fd
commit
cf68c63f61
1 changed files with 11 additions and 0 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue