Title: [166751] trunk/Source/WebCore
Revision
166751
Author
[email protected]
Date
2014-04-03 15:56:47 -0700 (Thu, 03 Apr 2014)

Log Message

Fix over-retain in SharedBufferCF's createCFData().
<https://webkit.org/b/131139>

Constructing the return type (RetainPtr<CFDataRef>) will also retain
the pointee, so this would end up leaking.

Reviewed by Anders Carlsson.

* platform/cf/SharedBufferCF.cpp:
(WebCore::SharedBuffer::createCFData):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (166750 => 166751)


--- trunk/Source/WebCore/ChangeLog	2014-04-03 22:55:39 UTC (rev 166750)
+++ trunk/Source/WebCore/ChangeLog	2014-04-03 22:56:47 UTC (rev 166751)
@@ -1,3 +1,16 @@
+2014-04-03  Andreas Kling  <[email protected]>
+
+        Fix over-retain in SharedBufferCF's createCFData().
+        <https://webkit.org/b/131139>
+
+        Constructing the return type (RetainPtr<CFDataRef>) will also retain
+        the pointee, so this would end up leaking.
+
+        Reviewed by Anders Carlsson.
+
+        * platform/cf/SharedBufferCF.cpp:
+        (WebCore::SharedBuffer::createCFData):
+
 2014-04-03  Brent Fulgham  <[email protected]>
 
         [Win] Turn on ENABLE_CSS_GRID_LAYOUT

Modified: trunk/Source/WebCore/platform/cf/SharedBufferCF.cpp (166750 => 166751)


--- trunk/Source/WebCore/platform/cf/SharedBufferCF.cpp	2014-04-03 22:55:39 UTC (rev 166750)
+++ trunk/Source/WebCore/platform/cf/SharedBufferCF.cpp	2014-04-03 22:56:47 UTC (rev 166751)
@@ -54,10 +54,8 @@
 #if !USE(FOUNDATION)
 RetainPtr<CFDataRef> SharedBuffer::createCFData()
 {
-    if (m_cfData) {
-        CFRetain(m_cfData.get());
-        return m_cfData.get();
-    }
+    if (m_cfData)
+        return m_cfData;
 
     // Internal data in SharedBuffer can be segmented. We need to get the contiguous buffer.
     const Vector<char>& contiguousBuffer = buffer();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to