Bug 413424 - PNG encoder leaks a string. r=stuart, a1.9=schrep, guilty=dolske
git-svn-id: svn://10.0.0.236/trunk@243765 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
b63f2be759
commit
4ab8753b51
@ -336,10 +336,12 @@ nsPNGEncoder::ParseOptions(const nsAString& aOptions,
|
||||
PRUint32* offsetX,
|
||||
PRUint32* offsetY)
|
||||
{
|
||||
char* token;
|
||||
char* options = nsCRT::strdup(PromiseFlatCString(NS_ConvertUTF16toUTF8(aOptions)).get());
|
||||
// Make a copy of aOptions, because strtok() will modify it.
|
||||
nsCAutoString optionsCopy;
|
||||
optionsCopy.Assign(NS_ConvertUTF16toUTF8(aOptions));
|
||||
char* options = optionsCopy.BeginWriting();
|
||||
|
||||
while ((token = nsCRT::strtok(options, ";", &options))) {
|
||||
while (char* token = nsCRT::strtok(options, ";", &options)) {
|
||||
// If there's an '=' character, split the token around it.
|
||||
char* equals = token, *value = nsnull;
|
||||
while(*equals != '=' && *equals) { ++equals; }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user