[Webkit-unassigned] [Bug 65790] New: [QT] Possible Leaks WKRetainPtr<> should Adopt allocated Copy

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 5 14:18:48 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=65790

           Summary: [QT] Possible Leaks WKRetainPtr<> should Adopt
                    allocated Copy
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit Qt
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: joepeck at webkit.org
                CC: psolanki at apple.com


shell> cd Source/
shell> a 'Retain.*?=.*?Copy'

    WebKit2/UIProcess/API/qt/qweberror.cpp
    61:    WKRetainPtr<WKStringRef> errorDomainPtr = adoptWK(WKErrorCopyDomain(d->error.get()));
    80:    WKRetainPtr<WKURLRef> failingURL = adoptWK(WKErrorCopyFailingURL(d->error.get()));

    WebKit2/UIProcess/qt/qwkhistory.cpp
    76:    WKRetainPtr<WKStringRef> title = WKBackForwardListItemCopyTitle(d->m_backForwardListItem.get());
    84:    WKRetainPtr<WKURLRef> url = WKBackForwardListItemCopyURL(d->m_backForwardListItem.get());

These look like possible leaks. Since WKRetainPtr::operator= does a WKRetain and typically a WK*Copy*()
will return a +1 allocation. I think the correct behavior here would be AdoptWK like:

    WebKit2/UIProcess/qt/qwkpreferences.cpp
    93:        WKRetainPtr<WKStringRef> stringRef(AdoptWK, WKPreferencesCopyStandardFontFamily(d->ref));

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list