зеркало из https://github.com/mozilla/gecko-dev.git
Always free the curren token at the end of HandleToken. bug 408939, r=bzbarsky sr=jst
This commit is contained in:
Родитель
16c69486d4
Коммит
b26e5da62a
|
@ -742,12 +742,11 @@ CNavDTD::HandleToken(CToken* aToken, nsIParser* aParser)
|
|||
break;
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(result) || NS_ERROR_HTMLPARSER_BLOCK == result) {
|
||||
IF_FREE(theToken, mTokenAllocator);
|
||||
} else if (result == NS_ERROR_HTMLPARSER_STOPPARSING) {
|
||||
IF_FREE(theToken, mTokenAllocator);
|
||||
if (result == NS_ERROR_HTMLPARSER_STOPPARSING) {
|
||||
mFlags |= NS_DTD_FLAG_STOP_PARSING;
|
||||
} else {
|
||||
return NS_OK;
|
||||
} else if (NS_FAILED(result) && result != NS_ERROR_HTMLPARSER_BLOCK) {
|
||||
result = NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2016,12 +2015,6 @@ CNavDTD::HandleDocTypeDeclToken(CToken* aToken)
|
|||
|
||||
IF_FREE(theNode, &mNodeAllocator);
|
||||
|
||||
// Hack for bug 395846, if we failed to add the node for whatever reason,
|
||||
// then we need to free the token ourselves.
|
||||
if (NS_FAILED(result) && result != NS_ERROR_HTMLPARSER_BLOCK) {
|
||||
IF_FREE(aToken, mTokenAllocator);
|
||||
}
|
||||
|
||||
MOZ_TIMER_DEBUGLOG(("Start: Parse Time: CNavDTD::HandleDocTypeDeclToken(), this=%p\n", this));
|
||||
START_TIMER();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче