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

Alexandre Julliard julliard at wine.codeweavers.com
Fri Nov 10 05:43:55 CST 2006


Module: wine
Branch: master
Commit: da3d6815da7f00379f3405a3640bba57d67784fc
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=da3d6815da7f00379f3405a3640bba57d67784fc

Author: Mike McCormack <mike at codeweavers.com>
Date:   Fri Nov 10 15:40:08 2006 +0900

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

---

 dlls/shlwapi/path.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/shlwapi/path.c b/dlls/shlwapi/path.c
index a1c114b..f958f56 100644
--- a/dlls/shlwapi/path.c
+++ b/dlls/shlwapi/path.c
@@ -1181,7 +1181,7 @@ static BOOL WINAPI SHLWAPI_PathFindInOth
   /* 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_PathFindInOth
 
     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;
 }
 




More information about the wine-cvs mailing list