mirror of
https://github.com/reactos/wine.git
synced 2025-04-06 01:51:46 +00:00
advpack: Free the file list on any error.
This commit is contained in:
parent
621a772d48
commit
ced5081eb9
@ -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,
|
|||||||
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);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user