Fix memory leaks

CID #716341
CID #716342

svn path=/trunk/; revision=62656
This commit is contained in:
Pierre Schweitzer 2014-04-06 13:50:53 +00:00
parent 360df6d05d
commit cfbaed3a33

View file

@ -199,7 +199,7 @@ GetEnvironmentVariables(HWND hwndListView,
lpData = GlobalAlloc(GPTR, (dwMaxValueDataLength + 1) * sizeof(TCHAR));
if (lpData == NULL)
{
GlobalFree(lpData);
GlobalFree(lpName);
RegCloseKey(hKey);
return;
}
@ -227,6 +227,7 @@ GetEnvironmentVariables(HWND hwndListView,
(LPBYTE)lpData,
&dwDataLength))
{
GlobalFree(lpExpandData);
GlobalFree(lpName);
GlobalFree(lpData);
RegCloseKey(hKey);