зеркало из https://github.com/mozilla/pjs.git
Don't crash on OOM. b=353997 r+sr=darin
This commit is contained in:
Родитель
60a88738bd
Коммит
8239dcb851
|
@ -456,6 +456,7 @@ void* AtomImpl::operator new ( size_t size, const nsACString& aString ) CPP_THRO
|
|||
*/
|
||||
size += aString.Length() * sizeof(char);
|
||||
AtomImpl* ii = NS_STATIC_CAST(AtomImpl*, ::operator new(size));
|
||||
NS_ENSURE_TRUE(ii, nsnull);
|
||||
|
||||
char* toBegin = &ii->mString[0];
|
||||
nsACString::const_iterator fromBegin, fromEnd;
|
||||
|
|
|
@ -211,6 +211,7 @@ nsCOMArrayEnumerator::operator new (size_t size, const nsCOMArray_base& aArray)
|
|||
// do the actual allocation
|
||||
nsCOMArrayEnumerator * result =
|
||||
NS_STATIC_CAST(nsCOMArrayEnumerator*, ::operator new(size));
|
||||
NS_ENSURE_TRUE(result, nsnull);
|
||||
|
||||
// now need to copy over the values, and addref each one
|
||||
// now this might seem like a lot of work, but we're actually just
|
||||
|
|
Загрузка…
Ссылка в новой задаче