bug 104042, more leaked exprResults. r=peterv, sr=jst

This commit is contained in:
axel%pike.org 2005-11-02 07:37:15 +00:00
parent 0c99f91d9e
commit 0445c09b06
2 changed files with 10 additions and 8 deletions

View File

@ -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(&params);
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) {

View File

@ -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(&params);
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) {