Bug 213690

Summary: REGRESSION (r262776): Leak of NSMutableURLRequest in -[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: WebCore Misc.Assignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, andersca, rwlbuis, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 211999, 213059    
Bug Blocks:    
Attachments:
Description Flags
Patch v1 none

Description David Kilzer (:ddkilzer) 2020-06-27 20:40:11 PDT
Leak of NSMutableURLRequest in -[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]:

+        if (equalLettersIgnoringASCIICase(m_handle->firstRequest().httpMethod(), "post") && !m_handle->firstRequest().hasHTTPHeaderField(HTTPHeaderName::ContentType)) {
+            NSMutableURLRequest *modifiedRequest = [newRequest mutableCopy];
+            [modifiedRequest setValue:nil forHTTPHeaderField:@"Content-Type"];
+            return modifiedRequest; // LEAK: This variable needs to be autoreleased.
+        }

Regressed with:

    Bug 211999: XMLHTTPRequest.send should not send Content-Type headers when Blob has no type
    <https://bugs.webkit.org/show_bug.cgi?id=211999>
    <https://trac.webkit.org/r262776>
Comment 1 Radar WebKit Bug Importer 2020-06-27 20:40:37 PDT
<rdar://problem/64853619>
Comment 2 David Kilzer (:ddkilzer) 2020-06-27 20:43:36 PDT
Created attachment 402980 [details]
Patch v1
Comment 3 EWS 2020-06-29 03:54:39 PDT
Committed r263653: <https://trac.webkit.org/changeset/263653>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 402980 [details].