shlwapi: Use HeapAlloc/Free instead of malloc/free.

This commit is contained in:
Mike McCormack 2006-11-10 15:40:08 +09:00 committed by Alexandre Julliard
parent 4bd117640d
commit da3d6815da
1 changed files with 4 additions and 4 deletions

View File

@ -1181,7 +1181,7 @@ static BOOL WINAPI SHLWAPI_PathFindInOtherDirs(LPWSTR lpszFile, DWORD dwWhich)
/* Try dirs listed in %PATH% */
dwLenPATH = GetEnvironmentVariableW(szPath, buff, MAX_PATH);
if (!dwLenPATH || !(lpszPATH = malloc((dwLenPATH + 1) * sizeof (WCHAR))))
if (!dwLenPATH || !(lpszPATH = HeapAlloc(GetProcessHeap, 0, (dwLenPATH + 1) * sizeof (WCHAR))))
return FALSE;
GetEnvironmentVariableW(szPath, lpszPATH, dwLenPATH + 1);
@ -1204,17 +1204,17 @@ static BOOL WINAPI SHLWAPI_PathFindInOtherDirs(LPWSTR lpszFile, DWORD dwWhich)
if (!PathAppendW(buff, lpszFile))
{
free(lpszPATH);
HeapFree(GetProcessHeap, 0, lpszPATH);
return FALSE;
}
if (PathFileExistsDefExtW(buff, dwWhich))
{
strcpyW(lpszFile, buff);
free(lpszPATH);
HeapFree(GetProcessHeap, 0, lpszPATH);
return TRUE;
}
}
free(lpszPATH);
HeapFree(GetProcessHeap, 0, lpszPATH);
return FALSE;
}