зеркало из https://github.com/mozilla/pjs.git
Bug 413424 - PNG encoder leaks a string. r=stuart, a1.9=schrep, guilty=dolske
This commit is contained in:
Родитель
4f10d56fb7
Коммит
1d7f2896ea
|
@ -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; }
|
||||
|
|
Загрузка…
Ссылка в новой задаче