diff --git a/extensions/spellcheck/osxspell/src/mozOSXSpell.mm b/extensions/spellcheck/osxspell/src/mozOSXSpell.mm index 295e77423b2..810d1d08347 100644 --- a/extensions/spellcheck/osxspell/src/mozOSXSpell.mm +++ b/extensions/spellcheck/osxspell/src/mozOSXSpell.mm @@ -115,8 +115,9 @@ NS_IMETHODIMP mozOSXSpell::GetLanguage(PRUnichar **aLanguage) } mLanguage.Assign(*aLanguage); } - else + else { *aLanguage = ToNewUnicode(mLanguage); + } return *aLanguage ? NS_OK : NS_ERROR_OUT_OF_MEMORY; @@ -299,6 +300,8 @@ NS_IMETHODIMP mozOSXSpell::Suggest(const PRUnichar *aWord, PRUnichar ***aSuggest PRUint32 length = [self length]; PRUnichar* retStr = (PRUnichar*)nsMemory::Alloc((length + 1) * sizeof(PRUnichar)); + if (!retStr) + return NULL; [self getCharacters:retStr]; retStr[length] = PRUnichar(0); return retStr;