RESOLVED FIXED 65806
Potential Leaks - RetainPtr<> over retaining Create'd objects
https://bugs.webkit.org/show_bug.cgi?id=65806
Summary Potential Leaks - RetainPtr<> over retaining Create'd objects
Joseph Pecoraro
Reported 2011-08-05 19:35:19 PDT
shell> cd Source/ shell> ack 'Retain.*?=.*?Create' WebCore/platform/network/mac/NetworkStateNotifierMac.cpp 108: RetainPtr<CFRunLoopSourceRef> configSource = SCDynamicStoreCreateRunLoopSource(0, m_store.get(), 0); WebCore/plugins/mac/PluginPackageMac.cpp 123: WTF::RetainPtr<CFStringRef> str = CFStringCreateWithPascalString(0, p, encoding); 143: WTF::RetainPtr<CFStringRef> path = CFStringCreateWithFormat(0, 0, CFSTR("%@/Library/Preferences/%@"), homeDir.get(), fileName.get()); WebKit/mac/WebView/WebView.mm 4215: RetainPtr<CFMutableSetRef> visitedViews = CFSetCreateMutable(0, 0, 0); The first looks harmless, the plugin ones look like it could be bad in encountered (in a loop), and the WebView one looks straightforward if ever encountered.
Attachments
[PATCH] Potential Fix (Untested, just code inspection and change) (4.19 KB, patch)
2011-08-05 19:46 PDT, Joseph Pecoraro
no flags
Joseph Pecoraro
Comment 1 2011-08-05 19:46:56 PDT
Created attachment 103141 [details] [PATCH] Potential Fix (Untested, just code inspection and change) Each of these looks like they should be an Adopt after reading the immediately surrounding code.
Darin Adler
Comment 2 2011-08-06 07:52:18 PDT
Did you do the same grep for Copy?
WebKit Review Bot
Comment 3 2011-08-06 09:17:28 PDT
Comment on attachment 103141 [details] [PATCH] Potential Fix (Untested, just code inspection and change) Clearing flags on attachment: 103141 Committed r92552: <http://trac.webkit.org/changeset/92552>
WebKit Review Bot
Comment 4 2011-08-06 09:17:32 PDT
All reviewed patches have been landed. Closing bug.
Joseph Pecoraro
Comment 5 2011-08-07 11:32:08 PDT
(In reply to comment #2) > Did you do the same grep for Copy? Yep that turned up both of these: <http://webkit.org/b/65789> Leak in CFNetwork Loader RetainPtr<> should Adopt a Copy allocation <http://webkit.org/b/65790> [QT] Possible Leaks WKRetainPtr<> should Adopt allocated Copy Thanks!
Note You need to log in before you can comment on or make changes to this bug.