Bug 1278452 - Fix a typo in mozEnglishWordUtils::GetLanguage. r=ehsan.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 07 Jun 2016 15:15:56 +1000
changeset 301028 ac0df3cacb3bf8356a9c9ca15c803b512b7de12e
parent 301027 d57948ecf695801b2950dd70c3340e91440102bc
child 301029 9b6d23819097bb067fd9bea9b9d45df0f7fdc062
push id19599
push usercbook@mozilla.com
push dateWed, 08 Jun 2016 10:16:21 +0000
treeherderfx-team@81f4cc3f6f4c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1278452
milestone50.0a1
Bug 1278452 - Fix a typo in mozEnglishWordUtils::GetLanguage. r=ehsan. |aLanguage| must be dereferenced when checked.
extensions/spellcheck/src/mozEnglishWordUtils.cpp
--- a/extensions/spellcheck/src/mozEnglishWordUtils.cpp
+++ b/extensions/spellcheck/src/mozEnglishWordUtils.cpp
@@ -33,23 +33,24 @@ mozEnglishWordUtils::mozEnglishWordUtils
 }
 
 mozEnglishWordUtils::~mozEnglishWordUtils()
 {
 }
 
 NS_IMETHODIMP mozEnglishWordUtils::GetLanguage(char16_t * *aLanguage)
 {
-  nsresult rv = NS_OK;
   NS_ENSURE_ARG_POINTER(aLanguage);
 
   *aLanguage = ToNewUnicode(mLanguage);
-  if(!aLanguage) rv = NS_ERROR_OUT_OF_MEMORY;
-  return rv;
- }
+  if (!*aLanguage) {
+    return NS_ERROR_OUT_OF_MEMORY;
+  }
+  return NS_OK;
+}
 
 // return the possible root forms of aWord.
 NS_IMETHODIMP mozEnglishWordUtils::GetRootForm(const char16_t *aWord, uint32_t type, char16_t ***words, uint32_t *count)
 {
   nsAutoString word(aWord);
   char16_t **tmpPtr;
   int32_t length = word.Length();