[ros-diffs] [cwittich] 45119: [advpack] update advpack to wine 1.1.36

cwittich at svn.reactos.org cwittich at svn.reactos.org
Sun Jan 17 09:29:57 CET 2010


Author: cwittich
Date: Sun Jan 17 09:29:56 2010
New Revision: 45119

URL: http://svn.reactos.org/svn/reactos?rev=45119&view=rev
Log:
[advpack]
update advpack to wine 1.1.36

Modified:
    trunk/reactos/dll/win32/advpack/files.c

Modified: trunk/reactos/dll/win32/advpack/files.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advpack/files.c?rev=45119&r1=45118&r2=45119&view=diff
==============================================================================
--- trunk/reactos/dll/win32/advpack/files.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advpack/files.c [iso-8859-1] Sun Jan 17 09:29:56 2010
@@ -279,13 +279,13 @@
     if (lpszDestFile)
     {
         dwLen = lstrlenW(lpszDestFile);
-        szDestFilename = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(WCHAR));
+        szDestFilename = HeapAlloc(GetProcessHeap(), 0, (dwLen+1) * sizeof(WCHAR));
         lstrcpyW(szDestFilename, lpszDestFile);
     }
     else
     {
         dwLen = lstrlenW(lpszSourceFile);
-        szDestFilename = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(WCHAR));
+        szDestFilename = HeapAlloc(GetProcessHeap(), 0, (dwLen+1) * sizeof(WCHAR));
         lstrcpyW(szDestFilename, lpszSourceFile);
     }
 
@@ -648,6 +648,18 @@
     return dwNumFound;
 }
 
+static void free_file_list(SESSION* session)
+{
+    struct FILELIST *next, *curr = session->FileList;
+
+    while (curr)
+    {
+        next = curr->next;
+        free_file_node(curr);
+        curr = next;
+    }
+}
+
 /***********************************************************************
  *             ExtractFilesA    (ADVPACK.@)
  *
@@ -728,20 +740,8 @@
     session.Operation |= EXTRACT_EXTRACTFILES;
     res = pExtract(&session, CabName);
 
-    if (session.FileList)
-    {
-        struct FILELIST *curr = session.FileList;
-        struct FILELIST *next;
-
-        while (curr)
-        {
-            next = curr->next;
-            free_file_node(curr);
-            curr = next;
-        }
-    }
-
 done:
+    free_file_list(&session);
     FreeLibrary(hCabinet);
     HeapFree(GetProcessHeap(), 0, szConvertedList);
 




More information about the Ros-diffs mailing list