Bug 484610 Fix mismatched allocators r=jst sr=peterv

This commit is contained in:
Neil Rashbrook 2010-02-20 15:25:21 +00:00
Родитель 0d74ad9962
Коммит 55df7d1f15
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -268,7 +268,7 @@ nsControllerCommandGroup::AddCommandToGroup(const char * aCommand, const char *a
mGroupsHash.Put(&groupKey, (void *)commandList);
}
// add the command to the list. Note that we're not checking for duplicates here
char* commandString = nsCRT::strdup(aCommand); // we store allocated PRUnichar* in the array
char* commandString = NS_strdup(aCommand); // we store allocated PRUnichar* in the array
if (!commandString) return NS_ERROR_OUT_OF_MEMORY;
PRBool appended = commandList->AppendElement(commandString) != nsnull;

Просмотреть файл

@ -167,7 +167,7 @@ NS_IMETHODIMP nsCommandParams::GetCStringValue(const char * name, char **_retval
if (foundEntry && foundEntry->mEntryType == eStringType)
{
NS_ASSERTION(foundEntry->mData.mCString, "Null string");
*_retval= nsCRT::strdup((*foundEntry->mData.mCString).get());
*_retval = ToNewCString(*foundEntry->mData.mCString);
return NS_OK;
}
@ -421,7 +421,7 @@ nsCommandParams::GetNext(char **_retval)
if (!thisEntry)
return NS_ERROR_FAILURE;
*_retval = nsCRT::strdup(thisEntry->mEntryName.get());
*_retval = ToNewCString(thisEntry->mEntryName);
mCurEntry++;
return NS_OK;
}