Title: [263653] trunk/Source/WebCore
Revision
263653
Author
ddkil...@apple.com
Date
2020-06-29 03:54:34 -0700 (Mon, 29 Jun 2020)

Log Message

REGRESSION (r262776): Leak of NSMutableURLRequest in -[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]
<https://webkit.org/b/213690>
<rdar://problem/64853619>

Reviewed by Anders Carlsson.

* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
- Use RetainPtr<> for the mutable copy and autorelease the
  return value.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (263652 => 263653)


--- trunk/Source/WebCore/ChangeLog	2020-06-29 10:19:10 UTC (rev 263652)
+++ trunk/Source/WebCore/ChangeLog	2020-06-29 10:54:34 UTC (rev 263653)
@@ -1,3 +1,16 @@
+2020-06-29  David Kilzer  <ddkil...@apple.com>
+
+        REGRESSION (r262776): Leak of NSMutableURLRequest in -[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]
+        <https://webkit.org/b/213690>
+        <rdar://problem/64853619>
+
+        Reviewed by Anders Carlsson.
+
+        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
+        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
+        - Use RetainPtr<> for the mutable copy and autorelease the
+          return value.
+
 2020-06-29  Youenn Fablet  <you...@apple.com>
 
         MediaRecorder.start() Method is Ignoring the "timeslice" Parameter

Modified: trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm (263652 => 263653)


--- trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm	2020-06-29 10:19:10 UTC (rev 263652)
+++ trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm	2020-06-29 10:54:34 UTC (rev 263653)
@@ -124,9 +124,9 @@
     if (!redirectResponse) {
         // CFNetwork will add "application/x-www-form-urlencoded" content-type for POST, even if no Content-Type was specified, remove it in that case.
         if (m_handle && equalLettersIgnoringASCIICase(m_handle->firstRequest().httpMethod(), "post") && !m_handle->firstRequest().hasHTTPHeaderField(HTTPHeaderName::ContentType)) {
-            NSMutableURLRequest *modifiedRequest = [newRequest mutableCopy];
-            [modifiedRequest setValue:nil forHTTPHeaderField:@"Content-Type"];
-            return modifiedRequest;
+            auto mutableModifiedRequest = adoptNS([newRequest mutableCopy]);
+            [mutableModifiedRequest setValue:nil forHTTPHeaderField:@"Content-Type"];
+            return mutableModifiedRequest.autorelease();
         }
         return newRequest;
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to