Author: jgardou
Date: Tue Sep 30 20:21:50 2014
New Revision: 64422
URL:
http://svn.reactos.org/svn/reactos?rev=64422&view=rev
Log:
[ADVAPI32]
- Fix a memory leak in failure case.
Spotted by Thomas.
CORE-8582
Modified:
trunk/reactos/dll/win32/advapi32/reg/hkcr.c
Modified: trunk/reactos/dll/win32/advapi32/reg/hkcr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/reg/hkc…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/reg/hkcr.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/reg/hkcr.c [iso-8859-1] Tue Sep 30 20:21:50 2014
@@ -46,6 +46,7 @@
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 @@
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);
}