Bug 66113

Summary: [CFNetwork] willCacheResponse() leaks CFCachedURLResponseRef if delegate changes CacheStoragePolicy
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: Page LoadingAssignee: David Kilzer (:ddkilzer) <ddkilzer>
Severity: Normal CC: aroben, jberlin, psolanki, webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Description Flags
Patch v1 none

Description David Kilzer (:ddkilzer) 2011-08-11 16:12:13 PDT
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
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.