MSI: Memory leak

Ulrich Czekalla ulrich.czekalla at utoronto.ca
Mon Mar 7 20:27:48 CST 2005


This patch fixes a potential memory leak caused by passing an incorrect
pointer to HeapFree.

ChangeLog:
    Ulrich Czekalla <ulrich at codeweavers.com>
    Fix memory leak
-------------- next part --------------
Index: dlls/msi/action.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/action.c,v
retrieving revision 1.98
diff -u -p -r1.98 action.c
--- dlls/msi/action.c	2 Mar 2005 13:53:51 -0000	1.98
+++ dlls/msi/action.c	8 Mar 2005 02:15:05 -0000
@@ -1892,7 +1892,7 @@ static INT load_folder(MSIPACKAGE *packa
          0};
     UINT rc;
     MSIQUERY * view;
-    LPWSTR targetdir, parent, srcdir;
+    LPWSTR ptargetdir, targetdir, parent, srcdir;
     MSIRECORD * row = 0;
     INT index = -1;
     DWORD i;
@@ -1943,7 +1943,7 @@ static INT load_folder(MSIPACKAGE *packa
         return -1;
     }
 
-    targetdir = load_dynamic_stringW(row,3);
+    ptargetdir = targetdir = load_dynamic_stringW(row,3);
 
     /* split src and target dir */
     if (strchrW(targetdir,':'))
@@ -1987,7 +1987,7 @@ static INT load_folder(MSIPACKAGE *packa
        package->folders[index].SourceDefault = dupstrW(srcdir);
     else if (targetdir)
         package->folders[index].SourceDefault = dupstrW(targetdir);
-    HeapFree(GetProcessHeap(), 0, targetdir);
+    HeapFree(GetProcessHeap(), 0, ptargetdir);
 
     parent = load_dynamic_stringW(row,2);
     if (parent) 


More information about the wine-patches mailing list