mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 01:35:35 +00:00
Bug 901947 - part 0b - use fallible allocation in HTMLFrameSetElement.cpp; r=smaug
This commit is contained in:
parent
dce6726880
commit
b2f68de751
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user