зеркало из https://github.com/mozilla/gecko-dev.git
Fix memory leak 13641: don't allocate a new CAttributeToken unless we're going to pass it to AddAttribute
This commit is contained in:
Родитель
750364ab73
Коммит
f9719054c5
|
@ -624,15 +624,18 @@ nsresult nsXIFDTD::HandleTextToken(CToken* aToken) {
|
|||
|
||||
|
||||
void nsXIFDTD::AddAttribute(nsIParserNode& aNode) {
|
||||
nsString key;
|
||||
nsString value;
|
||||
PRBool hasValue;
|
||||
|
||||
hasValue = GetAttributePair(aNode,key,value);
|
||||
CAttributeToken* attribute = new CAttributeToken(key,value);
|
||||
nsIParserNode* top = PeekNode();
|
||||
if (top != nsnull)
|
||||
{
|
||||
nsString key;
|
||||
nsString value;
|
||||
PRBool hasValue;
|
||||
|
||||
hasValue = GetAttributePair(aNode,key,value);
|
||||
// XXX should we still be calling AddAttribute if hasValue is false?
|
||||
CAttributeToken* attribute = new CAttributeToken(key,value);
|
||||
((nsCParserNode*)top)->AddAttribute(attribute);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -624,15 +624,18 @@ nsresult nsXIFDTD::HandleTextToken(CToken* aToken) {
|
|||
|
||||
|
||||
void nsXIFDTD::AddAttribute(nsIParserNode& aNode) {
|
||||
nsString key;
|
||||
nsString value;
|
||||
PRBool hasValue;
|
||||
|
||||
hasValue = GetAttributePair(aNode,key,value);
|
||||
CAttributeToken* attribute = new CAttributeToken(key,value);
|
||||
nsIParserNode* top = PeekNode();
|
||||
if (top != nsnull)
|
||||
{
|
||||
nsString key;
|
||||
nsString value;
|
||||
PRBool hasValue;
|
||||
|
||||
hasValue = GetAttributePair(aNode,key,value);
|
||||
// XXX should we still be calling AddAttribute if hasValue is false?
|
||||
CAttributeToken* attribute = new CAttributeToken(key,value);
|
||||
((nsCParserNode*)top)->AddAttribute(attribute);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче