Bug 1475282: Fix DEAD_STORE issues in ProfileReset. r=erahm
authorRobert Bartlensky <rbartlensky@mozilla.com>
Mon, 16 Jul 2018 18:27:16 +0100
changeset 427110 bce13e8f7d19
parent 427109 99ac85a273af
child 427111 c0585180a0c3
push id34292
push usercsabou@mozilla.com
push dateWed, 18 Jul 2018 17:18:53 +0000
treeherdermozilla-central@10ca5b14dbdb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerserahm
bugs1475282
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1475282: Fix DEAD_STORE issues in ProfileReset. r=erahm MozReview-Commit-ID: 45COqLBdEze
toolkit/xre/ProfileReset.cpp
--- a/toolkit/xre/ProfileReset.cpp
+++ b/toolkit/xre/ProfileReset.cpp
@@ -16,16 +16,17 @@
 #include "nsPIDOMWindow.h"
 #include "nsPrintfCString.h"
 #include "nsString.h"
 #include "nsToolkitCompsCID.h"
 #include "nsXPCOMCIDInternal.h"
 #include "mozilla/XREAppData.h"
 
 #include "mozilla/Services.h"
+#include "mozilla/Unused.h"
 #include "prtime.h"
 
 using namespace mozilla;
 
 extern const XREAppData* gAppData;
 
 static const char kProfileProperties[] =
   "chrome://mozapps/locale/profile/profileSelection.properties";
@@ -76,27 +77,28 @@ ProfileResetCleanup(nsIToolkitProfile* a
   rv = aOldProfile->GetLocalDir(getter_AddRefs(profileLocalDir));
   if (NS_FAILED(rv)) return rv;
 
   // Get the friendly name for the backup directory.
   nsCOMPtr<nsIStringBundleService> sbs = mozilla::services::GetStringBundleService();
   if (!sbs) return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIStringBundle> sb;
-  rv = sbs->CreateBundle(kProfileProperties, getter_AddRefs(sb));
+  Unused << sbs->CreateBundle(kProfileProperties, getter_AddRefs(sb));
   if (!sb) return NS_ERROR_FAILURE;
 
   NS_ConvertUTF8toUTF16 appName(gAppData->name);
   const char16_t* params[] = {appName.get(), appName.get()};
 
   nsAutoString resetBackupDirectoryName;
 
   static const char* kResetBackupDirectory = "resetBackupDirectory";
   rv = sb->FormatStringFromName(kResetBackupDirectory, params, 2,
                                 resetBackupDirectoryName);
+  if (NS_FAILED(rv)) return rv;
 
   // Get info to copy the old root profile dir to the desktop as a backup.
   nsCOMPtr<nsIFile> backupDest, containerDest, profileDest;
   rv = NS_GetSpecialDirectory(NS_OS_DESKTOP_DIR, getter_AddRefs(backupDest));
   if (NS_FAILED(rv)) {
     // Fall back to the home directory if the desktop is not available.
     rv = NS_GetSpecialDirectory(NS_OS_HOME_DIR, getter_AddRefs(backupDest));
     if (NS_FAILED(rv)) return rv;