fixed bug 6597 and added memory allocation conditioning

git-svn-id: svn://10.0.0.236/trunk@32284 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rickg%netscape.com
1999-05-19 05:01:46 +00:00
parent d2804028ef
commit 1f82bdb300
46 changed files with 226 additions and 290 deletions

View File

@@ -512,7 +512,9 @@ void nsHTMLContentSinkStream::EnsureBufferSize(PRInt32 aNewSize)
delete [] mBuffer;
mBufferSize = 2*aNewSize+1; // make the twice as large
mBuffer = new char[mBufferSize];
mBuffer[0] = 0;
if(mBuffer){
mBuffer[0] = 0;
}
}
}
@@ -946,9 +948,11 @@ void nsHTMLContentSinkStream::AddStartTag(const nsIParserNode& aNode)
const nsString& data = aNode.GetSkippedContent();
PRInt32 size = data.Length();
char* buffer = new char[size+1];
data.ToCString(buffer,size+1);
Write(buffer);
delete[] buffer;
if(buffer){
data.ToCString(buffer,size+1);
Write(buffer);
delete[] buffer;
}
}
else
{