mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-07 12:15:51 +00:00
bug 104042, more leaked exprResults. r=peterv, sr=jst
This commit is contained in:
parent
0c99f91d9e
commit
0445c09b06
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user