Bug 66113 - [CFNetwork] willCacheResponse() leaks CFCachedURLResponseRef if delegate changes CacheStoragePolicy
Summary: [CFNetwork] willCacheResponse() leaks CFCachedURLResponseRef if delegate chan...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-08-11 16:12 PDT by David Kilzer (:ddkilzer)
Modified: 2011-08-11 17:52 PDT (History)
4 users (show)

See Also:


Attachments
Patch v1 (2.33 KB, patch)
2011-08-11 16:28 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2011-08-11 16:12:13 PDT
* SUMMARY
If the delegate callback changes the CacheStoragePolicy in willCacheResponse() in ResourceHandleCFNet.cpp, the cachedResponse object is returned as +2 retained.  The contract for this method is to return a +1 retained object.

This regressed in ToT WebKit r23462.  <http://trac.webkit.org/changeset/23462>
Comment 1 David Kilzer (:ddkilzer) 2011-08-11 16:28:39 PDT
Created attachment 103700 [details]
Patch v1
Comment 2 David Kilzer (:ddkilzer) 2011-08-11 16:30:32 PDT
<rdar://problem/9941235>
Comment 3 Joseph Pecoraro 2011-08-11 16:51:41 PDT
Comment on attachment 103700 [details]
Patch v1

Great find!
Comment 4 WebKit Review Bot 2011-08-11 17:52:42 PDT
Comment on attachment 103700 [details]
Patch v1

Clearing flags on attachment: 103700

Committed r92897: <http://trac.webkit.org/changeset/92897>
Comment 5 WebKit Review Bot 2011-08-11 17:52:46 PDT
All reviewed patches have been landed.  Closing bug.