зеркало из https://github.com/mozilla/pjs.git
bug 104042, more leaked exprResults. r=peterv, sr=jst
This commit is contained in:
Родитель
2c00150994
Коммит
e66f740962
|
@ -1228,10 +1228,11 @@ void XSLTProcessor::processAction
|
|||
{
|
||||
expr = ps->getExpr(xslTemplate->getAttribute(TEST_ATTR));
|
||||
ExprResult* result = expr->evaluate(node, ps);
|
||||
if ( result->booleanValue() ) {
|
||||
if (result && result->booleanValue()) {
|
||||
processChildren(node, xslTemplate, ps);
|
||||
caseFound = MB_TRUE;
|
||||
}
|
||||
delete result;
|
||||
break;
|
||||
}
|
||||
case XSLType::OTHERWISE:
|
||||
|
|
|
@ -65,11 +65,11 @@ ExprResult* ElementAvailableFunctionCall::evaluate(Node* context, ContextState*
|
|||
ExprResult* result = NULL;
|
||||
|
||||
if ( requireParams(1,1,cs) ) {
|
||||
ListIterator* iter = params.iterator();
|
||||
Expr* param = (Expr*) iter->next();
|
||||
delete iter;
|
||||
ListIterator iter(¶ms);
|
||||
Expr* param = (Expr*) iter.next();
|
||||
ExprResult* exprResult = param->evaluate(context, cs);
|
||||
if (exprResult->getResultType() == ExprResult::STRING) {
|
||||
if (exprResult &&
|
||||
exprResult->getResultType() == ExprResult::STRING) {
|
||||
String property;
|
||||
exprResult->stringValue(property);
|
||||
if (XMLUtils::isValidQName(property)) {
|
||||
|
@ -122,6 +122,7 @@ ExprResult* ElementAvailableFunctionCall::evaluate(Node* context, ContextState*
|
|||
delete result;
|
||||
result = new StringResult(err);
|
||||
}
|
||||
delete exprResult;
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
|
|
|
@ -66,11 +66,11 @@ ExprResult* FunctionAvailableFunctionCall::evaluate(Node* context, ContextState*
|
|||
ExprResult* result = NULL;
|
||||
|
||||
if ( requireParams(1,1,cs) ) {
|
||||
ListIterator* iter = params.iterator();
|
||||
Expr* param = (Expr*) iter->next();
|
||||
delete iter;
|
||||
ListIterator iter(¶ms);
|
||||
Expr* param = (Expr*)iter.next();
|
||||
ExprResult* exprResult = param->evaluate(context, cs);
|
||||
if (exprResult->getResultType() == ExprResult::STRING) {
|
||||
if (exprResult &&
|
||||
exprResult->getResultType() == ExprResult::STRING) {
|
||||
String property;
|
||||
exprResult->stringValue(property);
|
||||
if (XMLUtils::isValidQName(property)) {
|
||||
|
@ -122,6 +122,7 @@ ExprResult* FunctionAvailableFunctionCall::evaluate(Node* context, ContextState*
|
|||
delete result;
|
||||
result = new StringResult(err);
|
||||
}
|
||||
delete exprResult;
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче