mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 505108: Don't leak strings on early returns from Area::ParseCoords(), fix how CString is freed. r=roc
This commit is contained in:
parent
c29b25bbce
commit
98b0626e03
@ -151,6 +151,7 @@ void Area::ParseCoords(const nsAString& aSpec)
|
||||
mCoords = nsnull;
|
||||
if (*cp == '\0')
|
||||
{
|
||||
nsMemory::Free(cp);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -164,6 +165,7 @@ void Area::ParseCoords(const nsAString& aSpec)
|
||||
}
|
||||
if (*n_str == '\0')
|
||||
{
|
||||
nsMemory::Free(cp);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -248,6 +250,7 @@ void Area::ParseCoords(const nsAString& aSpec)
|
||||
value_list = new nscoord[cnt];
|
||||
if (!value_list)
|
||||
{
|
||||
nsMemory::Free(cp);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -290,7 +293,7 @@ void Area::ParseCoords(const nsAString& aSpec)
|
||||
mNumCoords = cnt;
|
||||
mCoords = value_list;
|
||||
|
||||
NS_Free(cp);
|
||||
nsMemory::Free(cp);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user