Bug 1354068: fix uninitialized rv in some paths in nsWebShellWindow r=bdahl
authorRandell Jesup <rjesup@jesup.org>
Thu, 06 Apr 2017 23:23:44 -0400
changeset 351784 c858836be29efd3b0634ebc3532d220e32b342e8
parent 351783 83eeccc86babcfc64c268fb7fad04af05470578c
child 351785 228a6487d0c1f28321255f4be25444fff760a7a7
push id31621
push userarchaeopteryx@coole-files.de
push dateFri, 07 Apr 2017 20:14:04 +0000
treeherdermozilla-central@35c7be9c2db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbdahl
bugs1354068
milestone55.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 1354068: fix uninitialized rv in some paths in nsWebShellWindow r=bdahl MozReview-Commit-ID: LyQUAvVXlr2
xpfe/appshell/nsWebShellWindow.cpp
--- a/xpfe/appshell/nsWebShellWindow.cpp
+++ b/xpfe/appshell/nsWebShellWindow.cpp
@@ -147,24 +147,24 @@ nsresult nsWebShellWindow::Initialize(ns
 
   // XXX: need to get the default window size from prefs...
   // Doesn't come from prefs... will come from CSS/XUL/RDF
   DesktopIntRect deskRect(initialX, initialY, aInitialWidth, aInitialHeight);
 
   // Create top level window
   if (gfxPlatform::IsHeadless()) {
     mWindow = nsIWidget::CreateHeadlessWidget();
-    if (mWindow) {
-      rv = NS_OK;
+    if (!mWindow) {
+      return NS_ERROR_FAILURE;
     }
   } else {
     mWindow = do_CreateInstance(kWindowCID, &rv);
-  }
-  if (NS_OK != rv) {
-    return rv;
+    if (NS_OK != rv) {
+      return rv;
+    }
   }
 
   /* This next bit is troublesome. We carry two different versions of a pointer
      to our parent window. One is the parent window's widget, which is passed
      to our own widget. The other is a weak reference we keep here to our
      parent WebShellWindow. The former is useful to the widget, and we can't
      trust its treatment of the parent reference because they're platform-
      specific. The latter is useful to this class.