Title: [241034] trunk/Tools
Revision
241034
Author
ddkil...@apple.com
Date
2019-02-06 11:32:31 -0800 (Wed, 06 Feb 2019)

Log Message

WTR::InjectedBundlePage::willSendRequestForFrame() leaks a WKDataRef
<https://webkit.org/b/194286>
<rdar://problem/47815558>

Reviewed by Alexey Proskuryakov.

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::willSendRequestForFrame): Use
WKRetainPtr<> to avoid leaking the WKDataRef.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (241033 => 241034)


--- trunk/Tools/ChangeLog	2019-02-06 19:23:58 UTC (rev 241033)
+++ trunk/Tools/ChangeLog	2019-02-06 19:32:31 UTC (rev 241034)
@@ -1,3 +1,15 @@
+2019-02-06  David Kilzer  <ddkil...@apple.com>
+
+        WTR::InjectedBundlePage::willSendRequestForFrame() leaks a WKDataRef
+        <https://webkit.org/b/194286>
+        <rdar://problem/47815558>
+
+        Reviewed by Alexey Proskuryakov.
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::willSendRequestForFrame): Use
+        WKRetainPtr<> to avoid leaking the WKDataRef.
+
 2019-02-06  Michael Catanzaro  <mcatanz...@igalia.com>
 
         Unreviewed, fix a typo

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (241033 => 241034)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp	2019-02-06 19:23:58 UTC (rev 241033)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp	2019-02-06 19:32:31 UTC (rev 241034)
@@ -1211,7 +1211,8 @@
         String body = injectedBundle.testRunner()->willSendRequestHTTPBody();
         if (!body.isEmpty()) {
             CString cBody = body.utf8();
-            return WKURLRequestCopySettingHTTPBody(request, WKDataCreate(reinterpret_cast<const unsigned char*>(cBody.data()), cBody.length()));
+            WKRetainPtr<WKDataRef> body = adoptWK(WKDataCreate(reinterpret_cast<const unsigned char*>(cBody.data()), cBody.length()));
+            return WKURLRequestCopySettingHTTPBody(request, body.get());
         }
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to