Commit ced5081e authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

advpack: Free the file list on any error.

parent 621a772d
...@@ -648,6 +648,18 @@ static DWORD fill_file_list(SESSION *session, LPCSTR szCabName, LPCSTR szFileLis ...@@ -648,6 +648,18 @@ static DWORD fill_file_list(SESSION *session, LPCSTR szCabName, LPCSTR szFileLis
return dwNumFound; 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.@) * ExtractFilesA (ADVPACK.@)
* *
...@@ -728,20 +740,8 @@ HRESULT WINAPI ExtractFilesA(LPCSTR CabName, LPCSTR ExpandDir, DWORD Flags, ...@@ -728,20 +740,8 @@ HRESULT WINAPI ExtractFilesA(LPCSTR CabName, LPCSTR ExpandDir, DWORD Flags,
session.Operation |= EXTRACT_EXTRACTFILES; session.Operation |= EXTRACT_EXTRACTFILES;
res = pExtract(&session, CabName); 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: done:
free_file_list(&session);
FreeLibrary(hCabinet); FreeLibrary(hCabinet);
HeapFree(GetProcessHeap(), 0, szConvertedList); HeapFree(GetProcessHeap(), 0, szConvertedList);
......
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