Bug 231882 - WebKit::GPUConnectionToWebProcess::setTCCIdentity() leaks a tcc_identity_t
Summary: WebKit::GPUConnectionToWebProcess::setTCCIdentity() leaks a tcc_identity_t
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords: InRadar
Depends on: 231621
Blocks: 232507
  Show dependency treegraph
 
Reported: 2021-10-17 14:49 PDT by David Kilzer (:ddkilzer)
Modified: 2021-11-03 21:10 PDT (History)
6 users (show)

See Also:


Attachments
Patch v1 (4.00 KB, patch)
2021-10-17 16:36 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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
<rdar://problem/84350854>
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].