Commit 5f2e81e2 authored by Misha Koshelev's avatar Misha Koshelev Committed by Alexandre Julliard

msi: automation: Installer::Products, verify HeapAlloc return value.

parent 536b4990
......@@ -1386,12 +1386,16 @@ static HRESULT WINAPI InstallerImpl_Invoke(
/* Save product strings */
sldata = (StringListData *)private_data((AutomationObject *)pDispatch);
sldata->iCount = idx;
sldata->pszStrings = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LPWSTR)*sldata->iCount);
for (idx = 0; idx < sldata->iCount; idx++)
if (!(sldata->pszStrings = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LPWSTR)*sldata->iCount)))
ERR("Out of memory\n");
else
{
ret = MsiEnumProductsW(idx, szProductBuf);
sldata->pszStrings[idx] = SysAllocString(szProductBuf);
sldata->iCount = idx;
for (idx = 0; idx < sldata->iCount; idx++)
{
ret = MsiEnumProductsW(idx, szProductBuf);
sldata->pszStrings[idx] = SysAllocString(szProductBuf);
}
}
}
else
......
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