Author: cwittich
Date: Sat Jul 23 19:39:16 2016
New Revision: 71983
URL:
http://svn.reactos.org/svn/reactos?rev=71983&view=rev
Log:
[SHELL32] close hKey in error case
Modified:
trunk/reactos/dll/win32/shell32/CNewMenu.cpp
Modified: trunk/reactos/dll/win32/shell32/CNewMenu.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CNewMenu…
==============================================================================
--- trunk/reactos/dll/win32/shell32/CNewMenu.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CNewMenu.cpp [iso-8859-1] Sat Jul 23 19:39:16 2016
@@ -203,8 +203,8 @@
}
}
- dwSize++;
-
+ dwSize++;
+
lpValues = (LPWSTR) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize *
sizeof(WCHAR));
if (!lpValues)
return FALSE;
@@ -227,6 +227,7 @@
if (RegSetValueExW(hKey, L"Classes", NULL, REG_MULTI_SZ, (LPBYTE)lpValues,
dwSize * sizeof(WCHAR)) != ERROR_SUCCESS)
{
HeapFree(GetProcessHeap(), 0, lpValues);
+ RegCloseKey(hKey);
return FALSE;
}