Fixed a memory overflow and leak identified by Mike McCormack.

This commit is contained in:
Aric Stewart 2005-08-16 15:57:21 +00:00 committed by Alexandre Julliard
parent f3491aa935
commit 35706b6b4c
1 changed files with 2 additions and 1 deletions

View File

@ -3709,7 +3709,7 @@ UINT ACTION_ResolveSource(MSIPACKAGE* package)
INSTALLPROPERTY_DISKPROMPTW,NULL,&size);
if (rc == ERROR_MORE_DATA)
{
prompt = HeapAlloc(GetProcessHeap(),0,size);
prompt = HeapAlloc(GetProcessHeap(),0,size * sizeof(WCHAR));
MsiSourceListGetInfoW(package->ProductCode, NULL,
MSIINSTALLCONTEXT_USERMANAGED, MSICODE_PRODUCT,
INSTALLPROPERTY_DISKPROMPTW,prompt,&size);
@ -3728,6 +3728,7 @@ UINT ACTION_ResolveSource(MSIPACKAGE* package)
}
attrib = GetFileAttributesW(package->PackagePath);
}
HeapFree(GetProcessHeap(),0,prompt);
rc = ERROR_SUCCESS;
}
else