Bug 209932

Summary: REGRESSION (r258525): Leak of NSMutableAttributedString in -[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: AccessibilityAssignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, apinheiro, cfleizach, darin, dmazzoni, ews-watchlist, jcraig, jdiggs, samuel_white, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=209980
Bug Depends on: 209129    
Bug Blocks:    
Attachments:
Description Flags
Patch v1 none

Description David Kilzer (:ddkilzer) 2020-04-02 15:08:26 PDT
Leak of NSMutableAttributedString in -[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:].

        [...]
        RefPtr<Range> range = [protectedSelf rangeForTextMarkerRange:textMarkerRange];
        NSMutableAttributedString* attrString = [[NSMutableAttributedString alloc] init];
        if (!range)
            return nil;  // LEAK.
        TextIterator it(*range);
        [...]
Comment 1 Radar WebKit Bug Importer 2020-04-02 15:08:33 PDT
<rdar://problem/61228565>
Comment 2 David Kilzer (:ddkilzer) 2020-04-02 15:14:47 PDT
Created attachment 395308 [details]
Patch v1
Comment 3 Darin Adler 2020-04-02 16:06:15 PDT
Comment on attachment 395308 [details]
Patch v1

Thanks for catching that Dave. Strange that we were not using a RetainPtr.
Comment 4 EWS 2020-04-02 16:53:00 PDT
Committed r259428: <https://trac.webkit.org/changeset/259428>

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