Bug 901947 - part 0b - use fallible allocation in HTMLFrameSetElement.cpp; r=smaug

This commit is contained in:
Nathan Froyd 2013-08-08 13:54:07 -04:00
parent e54f07b5e6
commit 465ca0728d

View File

@ -121,10 +121,6 @@ HTMLFrameSetElement::GetRowSpec(int32_t *aNumValues,
if (!mRowSpecs) { // we may not have had an attr or had an empty attr
mRowSpecs = new nsFramesetSpec[1];
if (!mRowSpecs) {
mNumRows = 0;
return NS_ERROR_OUT_OF_MEMORY;
}
mNumRows = 1;
mRowSpecs[0].mUnit = eFramesetUnit_Relative;
mRowSpecs[0].mValue = 1;
@ -155,10 +151,6 @@ HTMLFrameSetElement::GetColSpec(int32_t *aNumValues,
if (!mColSpecs) { // we may not have had an attr or had an empty attr
mColSpecs = new nsFramesetSpec[1];
if (!mColSpecs) {
mNumCols = 0;
return NS_ERROR_OUT_OF_MEMORY;
}
mNumCols = 1;
mColSpecs[0].mUnit = eFramesetUnit_Relative;
mColSpecs[0].mValue = 1;
@ -239,7 +231,8 @@ HTMLFrameSetElement::ParseRowCol(const nsAString & aValue,
commaX = spec.FindChar(sComma, commaX + 1);
}
nsFramesetSpec* specs = new nsFramesetSpec[count];
static const fallible_t fallible = fallible_t();
nsFramesetSpec* specs = new (fallible) nsFramesetSpec[count];
if (!specs) {
*aSpecs = nullptr;
aNumSpecs = 0;