diff --git a/intl/locale/src/nsLanguageAtomService.cpp b/intl/locale/src/nsLanguageAtomService.cpp index 6f467cae9a2..2dfbaae3eac 100644 --- a/intl/locale/src/nsLanguageAtomService.cpp +++ b/intl/locale/src/nsLanguageAtomService.cpp @@ -110,10 +110,11 @@ nsLanguageAtomService::LookupLanguage(const nsAString &aLanguage, } } } - lang = do_GetAtom(langGroupStr); + nsCOMPtr langGroup = do_GetAtom(langGroupStr); // The hashtable will keep an owning reference to the atom mLangs.Put(lowered, lang); + lang = langGroup; } if (aError)