From e0fc18bcf3e62cad0031f0a54dc35762aff9afee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Tue, 30 Sep 2014 20:21:50 +0000 Subject: [PATCH] [ADVAPI32] - Fix a memory leak in failure case. Spotted by Thomas. CORE-8582 svn path=/trunk/; revision=64422 --- reactos/dll/win32/advapi32/reg/hkcr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reactos/dll/win32/advapi32/reg/hkcr.c b/reactos/dll/win32/advapi32/reg/hkcr.c index 081423bba6b..5180f4546ff 100644 --- a/reactos/dll/win32/advapi32/reg/hkcr.c +++ b/reactos/dll/win32/advapi32/reg/hkcr.c @@ -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); }