fusion: Avoid memory leaks on memory allocation failure in parse_display_name.

oldstable
Andrew Nguyen 2011-01-16 03:41:27 -06:00 committed by Alexandre Julliard
parent 3ed34dc325
commit e46c66a1f5
1 changed files with 10 additions and 3 deletions

View File

@ -562,7 +562,10 @@ static HRESULT parse_display_name(IAssemblyNameImpl *name, LPCWSTR szAssemblyNam
str = strdupW(szAssemblyName);
save = str;
if (!str)
return E_OUTOFMEMORY;
{
hr = E_OUTOFMEMORY;
goto done;
}
ptr = strchrW(str, ',');
if (ptr) *ptr = '\0';
@ -576,7 +579,10 @@ static HRESULT parse_display_name(IAssemblyNameImpl *name, LPCWSTR szAssemblyNam
name->name = strdupW(str);
if (!name->name)
return E_OUTOFMEMORY;
{
hr = E_OUTOFMEMORY;
goto done;
}
if (!ptr)
goto done;
@ -622,7 +628,8 @@ static HRESULT parse_display_name(IAssemblyNameImpl *name, LPCWSTR szAssemblyNam
else if (!lstrcmpW(str, procarch))
{
name->procarch = strdupW(ptr);
hr = S_OK;
if (!name->procarch)
hr = E_OUTOFMEMORY;
}
if (FAILED(hr))