Bug 1559407 - Don't redefine pref variable. r=frg
authorBill Gianopoulos <wgianopoulos@gmail.com>
Sat, 08 Jun 2019 07:03:15 -0400
changeset 35867 b26f815835648f3e0e80f9568d2adb33f5c97251
parent 35866 99b37b22c1f12f3dc8fb355c0c89c0cbf8402342
child 35868 793a15b6f65edb4f04051913786b829178829e4e
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersfrg
bugs1559407
Bug 1559407 - Don't redefine pref variable. r=frg
suite/components/profile/nsNetscapeProfileMigratorBase.cpp
--- a/suite/components/profile/nsNetscapeProfileMigratorBase.cpp
+++ b/suite/components/profile/nsNetscapeProfileMigratorBase.cpp
@@ -524,46 +524,46 @@ nsNetscapeProfileMigratorBase::ReadBranc
     return;
 
   for (auto& pref : prefs) {
     // Save each pref's value into an array
     char* currPref = moz_xstrdup(pref.get());
     int32_t type;
     branch->GetPrefType(currPref, &type);
 
-    PrefBranchStruct* pref = new PrefBranchStruct;
-    if (!pref) {
+    PrefBranchStruct* prefBranch = new PrefBranchStruct;
+    if (!prefBranch) {
       NS_WARNING("Could not create new PrefBranchStruct");
       free(currPref);
       return;
     }
-    pref->prefName = currPref;
-    pref->type = type;
+    prefBranch->prefName = currPref;
+    prefBranch->type = type;
 
     switch (type) {
     case nsIPrefBranch::PREF_STRING: {
       nsCString str;
       rv = branch->GetCharPref(currPref, str);
-      pref->stringValue = moz_xstrdup(str.get());
+      prefBranch->stringValue = moz_xstrdup(str.get());
       break;
     }
     case nsIPrefBranch::PREF_BOOL:
-      rv = branch->GetBoolPref(currPref, &pref->boolValue);
+      rv = branch->GetBoolPref(currPref, &prefBranch->boolValue);
       break;
     case nsIPrefBranch::PREF_INT:
-      rv = branch->GetIntPref(currPref, &pref->intValue);
+      rv = branch->GetIntPref(currPref, &prefBranch->intValue);
       break;
     default:
-      NS_WARNING("Invalid Pref Type in "
+      NS_WARNING("Invalid prefBranch Type in "
                  "nsNetscapeProfileMigratorBase::ReadBranch\n");
       break;
     }
 
     if (NS_SUCCEEDED(rv))
-      aPrefs.AppendElement(pref);
+      aPrefs.AppendElement(prefBranch);
   }
 }
 
 void
 nsNetscapeProfileMigratorBase::WriteBranch(const char * branchName,
                                            nsIPrefService* aPrefService,
                                            PBStructArray &aPrefs)
 {