Bug 619785 - nsComputedDOMStyle::DoGetMozBackgroundSize leaks valY when it has problems with valX, r+a=bz
authortimeless@mozdev.org
Thu, 16 Dec 2010 14:01:00 -0800
changeset 59467 aa18109c3a5c8a0f315b605989aa9418866ed7cd
parent 59466 a3106bdf31bbe8661a886922c8fa131a7aa14baf
child 59468 99b19e566bbfda6b74a7bafa34145c5e98de4b4d
push id17635
push userphilringnalda@gmail.com
push dateSun, 19 Dec 2010 18:11:24 +0000
treeherdermozilla-central@aa18109c3a5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs619785
milestone2.0b9pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 619785 - nsComputedDOMStyle::DoGetMozBackgroundSize leaks valY when it has problems with valX, r+a=bz
layout/style/nsComputedDOMStyle.cpp
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -1810,22 +1810,23 @@ nsComputedDOMStyle::DoGetMozBackgroundSi
         nsDOMCSSValueList *itemList = GetROCSSValueList(PR_FALSE);
         if (!itemList || !valueList->AppendCSSValue(itemList)) {
           delete valueList;
           delete itemList;
           return NS_ERROR_OUT_OF_MEMORY;
         }
 
         nsROCSSPrimitiveValue* valX = GetROCSSPrimitiveValue();
-        nsROCSSPrimitiveValue* valY = GetROCSSPrimitiveValue();
         if (!valX || !itemList->AppendCSSValue(valX)) {
           delete valueList;
           delete valX;
           return NS_ERROR_OUT_OF_MEMORY;
         }
+
+        nsROCSSPrimitiveValue* valY = GetROCSSPrimitiveValue();
         if (!valY || !itemList->AppendCSSValue(valY)) {
           delete valueList;
           delete valY;
           return NS_ERROR_OUT_OF_MEMORY;
         }
 
         if (size.mWidthType == nsStyleBackground::Size::eAuto) {
           valX->SetIdent(eCSSKeyword_auto);
@@ -2862,16 +2863,17 @@ nsComputedDOMStyle::DoGetCursor(nsIDOMCS
 
     if (item->mHaveHotspot) {
       nsROCSSPrimitiveValue *valX = GetROCSSPrimitiveValue();
       if (!valX || !itemList->AppendCSSValue(valX)) {
         delete valX;
         delete valueList;
         return NS_ERROR_OUT_OF_MEMORY;
       }
+
       nsROCSSPrimitiveValue *valY = GetROCSSPrimitiveValue();
       if (!valY || !itemList->AppendCSSValue(valY)) {
         delete valY;
         delete valueList;
         return NS_ERROR_OUT_OF_MEMORY;
       }
 
       valX->SetNumber(item->mHotspotX);