Fix for bug 660453 (Don't use txExecutionState if init fails).
authorPeter Van der Beken <peterv@propagandism.org>
Fri, 02 Sep 2011 15:06:23 -0700
changeset 77803 c3d40a5579b19af9cb595df338c4213af7e42ee5
parent 77802 7509ecc14e9ea65bf046e39b591aed35a863cb34
child 77804 fc2a18413a7e095cba32522a1874b75fc2d049d2
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs660453
milestone9.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
Fix for bug 660453 (Don't use txExecutionState if init fails).
content/xslt/src/xslt/txExecutionState.cpp
--- a/content/xslt/src/xslt/txExecutionState.cpp
+++ b/content/xslt/src/xslt/txExecutionState.cpp
@@ -81,17 +81,19 @@ txLoadedDocumentsHash::~txLoadedDocument
     txLoadedDocumentEntry* entry = GetEntry(baseURI);
     if (entry) {
         delete entry->mDocument.forget();
     }
 }
 
 txExecutionState::txExecutionState(txStylesheet* aStylesheet,
                                    PRBool aDisableLoads)
-    : mStylesheet(aStylesheet),
+    : mOutputHandler(nsnull),
+      mResultHandler(nsnull),
+      mStylesheet(aStylesheet),
       mNextInstruction(nsnull),
       mLocalVariables(nsnull),
       mRecursionDepth(0),
       mEvalContext(nsnull),
       mInitialEvalContext(nsnull),
       mGlobalParams(nsnull),
       mKeyHash(aStylesheet->getKeyMap()),
       mDisableLoads(aDisableLoads)
@@ -194,16 +196,19 @@ txExecutionState::init(const txXPathNode
 nsresult
 txExecutionState::end(nsresult aResult)
 {
     NS_ASSERTION(NS_FAILED(aResult) || mTemplateRules.Length() == 1,
                  "Didn't clean up template rules properly");
     if (NS_SUCCEEDED(aResult)) {
         popTemplateRule();
     }
+    else if (!mOutputHandler) {
+        return NS_OK;
+    }
     return mOutputHandler->endDocument(aResult);
 }
 
 
 
 nsresult
 txExecutionState::getVariable(PRInt32 aNamespace, nsIAtom* aLName,
                               txAExprResult*& aResult)