mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 14:24:45 +00:00
fusion: Avoid memory leaks on memory allocation failure in parse_display_name.
This commit is contained in:
parent
3ed34dc325
commit
e46c66a1f5
1 changed files with 10 additions and 3 deletions
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue