Bug 231882

Summary: WebKit::GPUConnectionToWebProcess::setTCCIdentity() leaks a tcc_identity_t
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: WebKit2Assignee: David Kilzer (:ddkilzer) <ddkilzer>
Severity: Normal CC: achristensen, cdumez, eric.carlson, katherine_cheney, kkinnunen, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 231621    
Bug Blocks: 232507    
Description Flags
Patch v1 none

Description David Kilzer (:ddkilzer) 2021-10-17 14:49:15 PDT
WebKit::GPUConnectionToWebProcess::setTCCIdentity() leaks a tcc_identity_t.

See Bug 231621, Comment #24 from Alex Christensen:

> Comment on attachment 441298 [details]
> Patch for landing
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=441298&action=review
> > Source/WebKit/GPUProcess/cocoa/GPUConnectionToWebProcessCocoa.mm:81
> > +    identity = tcc_identity_create(TCC_IDENTITY_CODE_BUNDLE_ID, [bundleProxy.bundleIdentifier UTF8String]);
> tcc_identity_create is annotated with OS_OBJECT_RETURNS_RETAINED, which
> means this is probably a memory leak.  It should probably be auto identity =
> adoptOSObject(tcc_identity_create(...)); which means my build fix of calling
> tcc_identity_t will probably also need to be changed to OS_OBJECT_DECL if
> OS_OBJECT_USE_OBJC is defined.
Comment 1 Radar WebKit Bug Importer 2021-10-17 14:50:18 PDT
Comment 2 David Kilzer (:ddkilzer) 2021-10-17 15:37:01 PDT
I have a potential fix.
Comment 3 David Kilzer (:ddkilzer) 2021-10-17 15:38:02 PDT
Waiting for Bug 231621 Attachment #441550 [details] to land first.
Comment 4 David Kilzer (:ddkilzer) 2021-10-17 16:36:49 PDT
Created attachment 441556 [details]
Patch v1
Comment 5 David Kilzer (:ddkilzer) 2021-10-18 08:20:28 PDT
Comment on attachment 441556 [details]
Patch v1

Thanks Chris!
Comment 6 EWS 2021-10-18 08:30:30 PDT
Committed r284373 (243158@main): <https://commits.webkit.org/243158@main>

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