Fix various memory leaks.

This commit is contained in:
Mike McCormack 2005-09-22 10:56:26 +00:00 committed by Alexandre Julliard
parent 994382b2ee
commit 470f23d471
5 changed files with 16 additions and 4 deletions

View File

@ -3967,6 +3967,7 @@ static UINT ITERATE_PublishComponent(MSIRECORD *rec, LPVOID param)
output = msi_alloc(sz);
memset(output,0,sz);
strcpyW(output,advertise);
msi_free(advertise);
if (text)
strcatW(output,text);

View File

@ -182,6 +182,7 @@ term:
| value_s
{
$$ = ($1 && $1[0]) ? MSICONDITION_TRUE : MSICONDITION_FALSE;
msi_free( $1 );
}
| value_i comp_op_i value_i
{
@ -190,18 +191,24 @@ term:
| value_s comp_op_s value_s
{
$$ = $2( $1, $3, FALSE );
msi_free( $1 );
msi_free( $3 );
}
| value_s COND_TILDA comp_op_s value_s
{
$$ = $3( $1, $4, TRUE );
msi_free( $1 );
msi_free( $4 );
}
| value_s comp_op_m1 value_i
{
$$ = $2( $1, $3 );
msi_free( $1 );
}
| value_i comp_op_m2 value_s
{
$$ = $2( $1, $3 );
msi_free( $3 );
}
| COND_LPAR expression COND_RPAR
{

View File

@ -193,7 +193,10 @@ UINT ACTION_CustomAction(MSIPACKAGE *package,LPCWSTR action, BOOL execute)
}
}
else if (!check_execution_scheduling_options(package,action,type))
{
msiobj_release(&row->hdr);
return ERROR_SUCCESS;
}
switch (type & CUSTOM_ACTION_TYPE_MASK)
{

View File

@ -214,18 +214,17 @@ static INT_PTR cabinet_notify(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
given_file = strdupAtoW(pfdin->psz1);
f = get_loaded_file(data->package, given_file);
msi_free(given_file);
if (!f)
{
ERR("Unknown File in Cabinent (%s)\n",debugstr_w(given_file));
msi_free(given_file);
ERR("Unknown File in Cabinet (%s)\n",debugstr_a(pfdin->psz1));
return 0;
}
if (!((f->State == 1 || f->State == 2)))
{
TRACE("Skipping extraction of %s\n",debugstr_w(given_file));
msi_free(given_file);
TRACE("Skipping extraction of %s\n",debugstr_a(pfdin->psz1));
return 0;
}

View File

@ -599,6 +599,8 @@ void ACTION_free_package_structures( MSIPACKAGE* package)
msi_free(package->PackagePath);
msi_free(package->msiFilePath);
msi_free(package->ProductCode);
msi_free(package->ActionFormat);
msi_free(package->LastAction);
/* cleanup control event subscriptions */
ControlEvent_CleanupSubscriptions(package);