Fix crash in parameters code.
b=101946 r=peterv sr=shaver git-svn-id: svn://10.0.0.236/trunk@103981 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
48a21fff28
commit
93aad19662
@ -1628,10 +1628,12 @@ NamedMap* XSLTProcessor::processParameters(Element* xslAction, Node* context, Pr
|
||||
{
|
||||
NamedMap* params = new NamedMap();
|
||||
|
||||
if ( !xslAction ) {
|
||||
if (!xslAction || !params) {
|
||||
return params;
|
||||
}
|
||||
|
||||
params->setObjectDeletion(MB_TRUE);
|
||||
|
||||
//-- handle xsl:with-param elements
|
||||
Node* tmpNode = xslAction->getFirstChild();
|
||||
while (tmpNode) {
|
||||
@ -1712,6 +1714,24 @@ void XSLTProcessor::processTemplate(Node* node, Node* xslTemplate, ProcessorStat
|
||||
processAction(node,tmp,ps);
|
||||
tmp = tmp->getNextSibling();
|
||||
}
|
||||
|
||||
if (params) {
|
||||
StringList* keys = params->keys();
|
||||
if (keys) {
|
||||
StringListIterator keyIter(keys);
|
||||
String* key;
|
||||
while((key = keyIter.next()))
|
||||
localBindings.remove(*key);
|
||||
}
|
||||
else {
|
||||
// out of memory so we can't get the keys
|
||||
// don't delete any variables since it's better we leak then
|
||||
// crash
|
||||
localBindings.setObjectDeletion(MB_FALSE);
|
||||
}
|
||||
delete keys;
|
||||
}
|
||||
|
||||
bindings->pop();
|
||||
} //-- processTemplate
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user