Fix fastMalloc/delete mismatches in CSS parser
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Sep 2013 17:33:44 +0000 (17:33 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Sep 2013 17:33:44 +0000 (17:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=120864

Reviewed by Andreas Kling.

Stop putting fastMalloced memory inside an OwnPtr.

* css/CSSParserValues.cpp:
(WebCore::CSSParserSelector::CSSParserSelector):
(WebCore::CSSParserSelector::adoptSelectorVector):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155195 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/css/CSSParserValues.cpp

index 8c98467..04678d9 100644 (file)
@@ -1,3 +1,16 @@
+2013-09-06  Anders Carlsson  <andersca@apple.com>
+
+        Fix fastMalloc/delete mismatches in CSS parser
+        https://bugs.webkit.org/show_bug.cgi?id=120864
+
+        Reviewed by Andreas Kling.
+
+        Stop putting fastMalloced memory inside an OwnPtr.
+
+        * css/CSSParserValues.cpp:
+        (WebCore::CSSParserSelector::CSSParserSelector):
+        (WebCore::CSSParserSelector::adoptSelectorVector):
+
 2013-09-06  Andreas Kling  <akling@apple.com>
 
         FrameLoader::subresourceLoader() should return a reference.
index 7d5fc85..7df10ef 100644 (file)
@@ -149,7 +149,7 @@ PassRefPtr<CSSValue> CSSParserValue::createCSSValue()
 }
 
 CSSParserSelector::CSSParserSelector()
-    : m_selector(adoptPtr(fastNew<CSSSelector>()))
+    : m_selector(adoptPtr(new CSSSelector))
 {
 }
 
@@ -175,9 +175,9 @@ CSSParserSelector::~CSSParserSelector()
 
 void CSSParserSelector::adoptSelectorVector(Vector<OwnPtr<CSSParserSelector> >& selectorVector)
 {
-    CSSSelectorList* selectorList = fastNew<CSSSelectorList>();
+    OwnPtr<CSSSelectorList> selectorList = adoptPtr(new CSSSelectorList);
     selectorList->adoptSelectorVector(selectorVector);
-    m_selector->setSelectorList(adoptPtr(selectorList));
+    m_selector->setSelectorList(selectorList.release());
 }
 
 bool CSSParserSelector::isSimple() const