Andrew Talbot : dbghelp: Cast-qual warnings fix.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Oct 30 05:22:21 CST 2006


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

Author: Andrew Talbot <Andrew.Talbot at talbotville.com>
Date:   Sat Oct 28 17:26:18 2006 +0100

dbghelp: Cast-qual warnings fix.

---

 dlls/dbghelp/path.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/dlls/dbghelp/path.c b/dlls/dbghelp/path.c
index f297011..59e87de 100644
--- a/dlls/dbghelp/path.c
+++ b/dlls/dbghelp/path.c
@@ -349,6 +349,7 @@ BOOL WINAPI SymFindFileInPath(HANDLE hPr
     struct process*     pcs = process_find_by_handle(hProcess);
     char                tmp[MAX_PATH];
     char*               ptr;
+    char*               buf = NULL;
     const char*         filename;
     const char*         searchPath = inSearchPath;
 
@@ -360,7 +361,6 @@ BOOL WINAPI SymFindFileInPath(HANDLE hPr
     if (!searchPath)
     {
         unsigned len = WideCharToMultiByte(CP_ACP, 0, pcs->search_path, -1, NULL, 0, NULL, NULL);
-        char* buf;
 
         searchPath = buf = HeapAlloc(GetProcessHeap(), 0, len);
         if (!searchPath) return FALSE;
@@ -381,8 +381,7 @@ BOOL WINAPI SymFindFileInPath(HANDLE hPr
     if (sffip_cb(full_path, &s))
     {
         strcpy(buffer, full_path);
-        if (searchPath != inSearchPath)
-            HeapFree(GetProcessHeap(), 0, (char*)searchPath);
+        HeapFree(GetProcessHeap(), 0, buf);
         return TRUE;
     }
 
@@ -403,12 +402,10 @@ BOOL WINAPI SymFindFileInPath(HANDLE hPr
         if (do_search(filename, tmp, FALSE, sffip_cb, &s))
         {
             strcpy(buffer, tmp);
-            if (searchPath != inSearchPath)
-                HeapFree(GetProcessHeap(), 0, (char*)searchPath);
+            HeapFree(GetProcessHeap(), 0, buf);
             return TRUE;
         }
     }
-    if (searchPath != inSearchPath)
-        HeapFree(GetProcessHeap(), 0, (char*)searchPath);
+    HeapFree(GetProcessHeap(), 0, buf);
     return FALSE;
 }




More information about the wine-cvs mailing list