Bug 485286 - Allocate all of these consistently. r+sr=peterv/sicking (a=ss for checkin into a CLOSED TREE).

This commit is contained in:
Blake Kaplan 2009-03-26 00:23:09 -07:00
Родитель 7dd075fba9
Коммит 77a43455ed
1 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -388,17 +388,20 @@ nsresult txXSLKey::testNode(const txXPathNode& aNode,
PRUint32 currKey, numKeys = mKeys.Length();
for (currKey = 0; currKey < numKeys; ++currKey) {
if (mKeys[currKey].matchPattern->matches(aNode, &aEs)) {
txSingleNodeContext evalContext(aNode, &aEs);
nsresult rv = aEs.pushEvalContext(&evalContext);
txSingleNodeContext *evalContext =
new txSingleNodeContext(aNode, &aEs);
NS_ENSURE_TRUE(evalContext, NS_ERROR_OUT_OF_MEMORY);
nsresult rv = aEs.pushEvalContext(evalContext);
NS_ENSURE_SUCCESS(rv, rv);
nsRefPtr<txAExprResult> exprResult;
rv = mKeys[currKey].useExpr->evaluate(&evalContext,
rv = mKeys[currKey].useExpr->evaluate(evalContext,
getter_AddRefs(exprResult));
aEs.popEvalContext();
NS_ENSURE_SUCCESS(rv, rv);
delete aEs.popEvalContext();
if (exprResult->getResultType() == txAExprResult::NODESET) {
txNodeSet* res = static_cast<txNodeSet*>
(static_cast<txAExprResult*>