[ADVAPI32]

- Fix a memory leak in failure case.
Spotted by Thomas.
CORE-8582

svn path=/trunk/; revision=64422
This commit is contained in:
Jérôme Gardou 2014-09-30 20:21:50 +00:00
parent ca7384efaa
commit e0fc18bcf3

View file

@ -46,6 +46,7 @@ GetKeyName(HKEY hKey, PUNICODE_STRING KeyName)
Status = NtQueryKey(hKey, KeyNameInformation, NameInformation, InfoLength, &InfoLength);
if (!NT_SUCCESS(Status))
{
RtlFreeHeap(RtlGetProcessHeap(), 0, NameInformation);
ERR("NtQueryKey failed: 0x%08x\n", Status);
return RtlNtStatusToDosError(Status);
}
@ -58,6 +59,7 @@ GetKeyName(HKEY hKey, PUNICODE_STRING KeyName)
Status = RtlDuplicateUnicodeString(RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE, &InfoName, KeyName);
if (!NT_SUCCESS(Status))
{
RtlFreeHeap(RtlGetProcessHeap(), 0, NameInformation);
ERR("RtlDuplicateUnicodeString failed: 0x%08x\n", Status);
return RtlNtStatusToDosError(Status);
}