From 4cae9e9df284bedfced2d0e236fce4d23fdc915a Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Mon, 26 Feb 2018 20:37:58 +0000 Subject: [PATCH] Bug 1428795 - Reset Marionette state when initialisation fails. r=automatedtester If Marionette throws inside try...catch block that spawns the TCP listener, we fail to reset the altered recommended preferences to their original state, leaving a possibility of tainting the profile. By calling the uninitialisation code when an error is thrown we ensure all relevant state gets reset. MozReview-Commit-ID: XiiIEFMZQY --HG-- extra : rebase_source : 1a38e446931c916af7f37ffc928683df47f0bba4 --- testing/marionette/components/marionette.js | 1 + 1 file changed, 1 insertion(+) diff --git a/testing/marionette/components/marionette.js b/testing/marionette/components/marionette.js index 846cebdfc31d..01eb89b1cf67 100644 --- a/testing/marionette/components/marionette.js +++ b/testing/marionette/components/marionette.js @@ -549,6 +549,7 @@ class MarionetteMainProcess { this.server = listener; } catch (e) { log.fatal("Remote protocol server failed to start", e); + this.uninit(); Services.startup.quit(Ci.nsIAppStartup.eForceQuit); }