Don't crash on OOM. b=353997 r+sr=darin

This commit is contained in:
mats.palmgren@bredband.net
2006-09-30 05:15:57 +00:00
parent a305304ffd
commit 7f3bcc12a7
2 changed files with 2 additions and 0 deletions

View File

@@ -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