зеркало из https://github.com/mozilla/pjs.git
Fix crash when typing ISO-8859-1 and then non-ISO-8859-1 character, and some leaks too. r=sicking sr=bzbarsky
This commit is contained in:
Родитель
52662ce41b
Коммит
ce90346d95
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче