OOM check. r+sr=bzbarsky b=188803

This commit is contained in:
dbaron%dbaron.org 2003-06-18 03:02:01 +00:00
parent 6560910dc0
commit 146a7a98ed
2 changed files with 4 additions and 0 deletions

View File

@ -985,6 +985,8 @@ DOMCSSDeclarationImpl::DeclarationChanged()
nsCOMPtr<nsICSSStyleRule> oldRule = mRule;
mRule = oldRule->DeclarationChanged(PR_TRUE).get();
if (!mRule)
return NS_ERROR_OUT_OF_MEMORY;
nsrefcnt cnt = mRule->Release();
NS_ASSERTION(cnt != 0, "container didn't take ownership");

View File

@ -985,6 +985,8 @@ DOMCSSDeclarationImpl::DeclarationChanged()
nsCOMPtr<nsICSSStyleRule> oldRule = mRule;
mRule = oldRule->DeclarationChanged(PR_TRUE).get();
if (!mRule)
return NS_ERROR_OUT_OF_MEMORY;
nsrefcnt cnt = mRule->Release();
NS_ASSERTION(cnt != 0, "container didn't take ownership");