Commit da3d6815 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

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

parent 4bd11764
...@@ -1181,7 +1181,7 @@ static BOOL WINAPI SHLWAPI_PathFindInOtherDirs(LPWSTR lpszFile, DWORD dwWhich) ...@@ -1181,7 +1181,7 @@ static BOOL WINAPI SHLWAPI_PathFindInOtherDirs(LPWSTR lpszFile, DWORD dwWhich)
/* Try dirs listed in %PATH% */ /* Try dirs listed in %PATH% */
dwLenPATH = GetEnvironmentVariableW(szPath, buff, MAX_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; return FALSE;
GetEnvironmentVariableW(szPath, lpszPATH, dwLenPATH + 1); GetEnvironmentVariableW(szPath, lpszPATH, dwLenPATH + 1);
...@@ -1204,17 +1204,17 @@ static BOOL WINAPI SHLWAPI_PathFindInOtherDirs(LPWSTR lpszFile, DWORD dwWhich) ...@@ -1204,17 +1204,17 @@ static BOOL WINAPI SHLWAPI_PathFindInOtherDirs(LPWSTR lpszFile, DWORD dwWhich)
if (!PathAppendW(buff, lpszFile)) if (!PathAppendW(buff, lpszFile))
{ {
free(lpszPATH); HeapFree(GetProcessHeap, 0, lpszPATH);
return FALSE; return FALSE;
} }
if (PathFileExistsDefExtW(buff, dwWhich)) if (PathFileExistsDefExtW(buff, dwWhich))
{ {
strcpyW(lpszFile, buff); strcpyW(lpszFile, buff);
free(lpszPATH); HeapFree(GetProcessHeap, 0, lpszPATH);
return TRUE; return TRUE;
} }
} }
free(lpszPATH); HeapFree(GetProcessHeap, 0, lpszPATH);
return FALSE; return FALSE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment