cch = wcslen(buffer) + 1;
CurProfile->filename = HeapAlloc(GetProcessHeap(), 0, cch * sizeof(WCHAR));
if (CurProfile->filename == NULL)
+ {
+ if (hFile != INVALID_HANDLE_VALUE) CloseHandle(hFile);
return FALSE;
+ }
StringCchCopyW(CurProfile->filename, cch, buffer);