Commit 51cf7d13 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

Free allocated buffers.

parent d5980989
......@@ -423,6 +423,47 @@ void ACTION_remove_tracked_tempfiles(MSIPACKAGE* package)
}
}
/* Called when the package is being closed */
extern void ACTION_free_package_structures( MSIPACKAGE* package)
{
INT i;
TRACE("Freeing package action data\n");
/* No dynamic buffers in features */
if (package->features && package->loaded_features > 0)
HeapFree(GetProcessHeap(),0,package->features);
for (i = 0; i < package->loaded_folders; i++)
{
HeapFree(GetProcessHeap(),0,package->folders[i].Directory);
HeapFree(GetProcessHeap(),0,package->folders[i].TargetDefault);
HeapFree(GetProcessHeap(),0,package->folders[i].SourceDefault);
HeapFree(GetProcessHeap(),0,package->folders[i].ResolvedTarget);
HeapFree(GetProcessHeap(),0,package->folders[i].ResolvedSource);
HeapFree(GetProcessHeap(),0,package->folders[i].Property);
}
if (package->folders && package->loaded_folders > 0)
HeapFree(GetProcessHeap(),0,package->folders);
/* no dynamic buffers in components */
if (package->components && package->loaded_components > 0)
HeapFree(GetProcessHeap(),0,package->components);
for (i = 0; i < package->loaded_files; i++)
{
HeapFree(GetProcessHeap(),0,package->files[i].File);
HeapFree(GetProcessHeap(),0,package->files[i].FileName);
HeapFree(GetProcessHeap(),0,package->files[i].Version);
HeapFree(GetProcessHeap(),0,package->files[i].Language);
HeapFree(GetProcessHeap(),0,package->files[i].SourcePath);
HeapFree(GetProcessHeap(),0,package->files[i].TargetPath);
}
if (package->files && package->loaded_files > 0)
HeapFree(GetProcessHeap(),0,package->files);
}
static UINT ACTION_OpenQuery( MSIDATABASE *db, MSIQUERY **view, LPCWSTR fmt, ... )
{
LPWSTR szQuery;
......
......@@ -273,6 +273,7 @@ extern UINT read_raw_stream_data( MSIDATABASE*, LPCWSTR stname,
USHORT **pdata, UINT *psz );
extern UINT ACTION_DoTopLevelINSTALL( MSIPACKAGE *, LPCWSTR, LPCWSTR );
extern void ACTION_remove_tracked_tempfiles( MSIPACKAGE* );
extern void ACTION_free_package_structures( MSIPACKAGE* );
/* record internals */
extern UINT MSI_RecordSetIStream( MSIRECORD *, unsigned int, IStream *);
......
......@@ -53,18 +53,8 @@ void MSI_FreePackage( MSIOBJECTHDR *arg)
MSIPACKAGE *package= (MSIPACKAGE*) arg;
ACTION_remove_tracked_tempfiles(package);
ACTION_free_package_structures(package);
if (package->features && package->loaded_features > 0)
HeapFree(GetProcessHeap(),0,package->features);
if (package->folders && package->loaded_folders > 0)
HeapFree(GetProcessHeap(),0,package->folders);
if (package->components && package->loaded_components > 0)
HeapFree(GetProcessHeap(),0,package->components);
if (package->files && package->loaded_files > 0)
HeapFree(GetProcessHeap(),0,package->files);
msiobj_release( &package->db->hdr );
}
......
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