Fix crash when typing ISO-8859-1 and then non-ISO-8859-1 character, and some leaks too. r=sicking sr=bzbarsky
git-svn-id: svn://10.0.0.236/trunk@193245 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -331,11 +331,12 @@ nsTextFragment::Append(const nsAString& aData)
|
||||
mState.mLength += len;
|
||||
mState.mIs2b = PR_TRUE;
|
||||
|
||||
if (!mState.mInHeap) {
|
||||
if (mState.mInHeap) {
|
||||
nsMemory::Free(m2b);
|
||||
}
|
||||
m2b = buff;
|
||||
|
||||
mState.mInHeap = PR_TRUE;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -356,6 +357,7 @@ nsTextFragment::Append(const nsAString& aData)
|
||||
}
|
||||
|
||||
memcpy(buff, m1b, mState.mLength);
|
||||
mState.mInHeap = PR_TRUE;
|
||||
}
|
||||
|
||||
for (PRUint32 i = 0; i < len; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user