mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[ADVAPI32]
- Fix a memory leak in failure case. Spotted by Thomas. CORE-8582 svn path=/trunk/; revision=64422
This commit is contained in:
parent
ca7384efaa
commit
e0fc18bcf3
1 changed files with 2 additions and 0 deletions
|
@ -46,6 +46,7 @@ GetKeyName(HKEY hKey, PUNICODE_STRING KeyName)
|
||||||
Status = NtQueryKey(hKey, KeyNameInformation, NameInformation, InfoLength, &InfoLength);
|
Status = NtQueryKey(hKey, KeyNameInformation, NameInformation, InfoLength, &InfoLength);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
RtlFreeHeap(RtlGetProcessHeap(), 0, NameInformation);
|
||||||
ERR("NtQueryKey failed: 0x%08x\n", Status);
|
ERR("NtQueryKey failed: 0x%08x\n", Status);
|
||||||
return RtlNtStatusToDosError(Status);
|
return RtlNtStatusToDosError(Status);
|
||||||
}
|
}
|
||||||
|
@ -58,6 +59,7 @@ GetKeyName(HKEY hKey, PUNICODE_STRING KeyName)
|
||||||
Status = RtlDuplicateUnicodeString(RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE, &InfoName, KeyName);
|
Status = RtlDuplicateUnicodeString(RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE, &InfoName, KeyName);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
RtlFreeHeap(RtlGetProcessHeap(), 0, NameInformation);
|
||||||
ERR("RtlDuplicateUnicodeString failed: 0x%08x\n", Status);
|
ERR("RtlDuplicateUnicodeString failed: 0x%08x\n", Status);
|
||||||
return RtlNtStatusToDosError(Status);
|
return RtlNtStatusToDosError(Status);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue