diff --git a/mozilla/htmlparser/src/nsParser.cpp b/mozilla/htmlparser/src/nsParser.cpp
index 703200e159a..c275743e6f5 100644
--- a/mozilla/htmlparser/src/nsParser.cpp
+++ b/mozilla/htmlparser/src/nsParser.cpp
@@ -958,14 +958,13 @@ aContentType,PRBool aVerifyEnabled,PRBool aLastCall,eParseMode aMode){
eAutoDetectResult theStatus=eUnknownDetect;
if(mParserContext && (mParserContext->mSourceType==aContentType)) {
- theDTD=mParserContext->mDTD;
+ mParserContext->mDTD->CreateNewInstance(&theDTD); // To fix bug 32263
theStatus=mParserContext->mAutoDetectStatus;
//added this to fix bug 32022.
}
pc=new CParserContext(theScanner,aKey, 0,theDTD,theStatus,aLastCall);
-
if(pc && theScanner) {
PushContext(*pc);
diff --git a/mozilla/parser/htmlparser/src/nsParser.cpp b/mozilla/parser/htmlparser/src/nsParser.cpp
index 703200e159a..c275743e6f5 100644
--- a/mozilla/parser/htmlparser/src/nsParser.cpp
+++ b/mozilla/parser/htmlparser/src/nsParser.cpp
@@ -958,14 +958,13 @@ aContentType,PRBool aVerifyEnabled,PRBool aLastCall,eParseMode aMode){
eAutoDetectResult theStatus=eUnknownDetect;
if(mParserContext && (mParserContext->mSourceType==aContentType)) {
- theDTD=mParserContext->mDTD;
+ mParserContext->mDTD->CreateNewInstance(&theDTD); // To fix bug 32263
theStatus=mParserContext->mAutoDetectStatus;
//added this to fix bug 32022.
}
pc=new CParserContext(theScanner,aKey, 0,theDTD,theStatus,aLastCall);
-
if(pc && theScanner) {
PushContext(*pc);