зеркало из https://github.com/mozilla/gecko-dev.git
Bug 484610 Fix mismatched allocators r=jst sr=peterv
This commit is contained in:
Родитель
0d74ad9962
Коммит
55df7d1f15
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче