Skip to content

Conversation

@Lessica
Copy link

@Lessica Lessica commented Jan 28, 2026

Fixes a memory leak in the getProcessExtensions function where the SecTask object created by SecTaskCreateWithAuditToken was never released.

Changes:

  • Added null check after creating secTask for safety
  • Added CFRelease(secTask) after retrieving the signing identifier to properly release the CoreFoundation object
  • Added early return if secTask creation fails

Testing:

The changes follow CoreFoundation memory management rules where objects returned by Create functions must be released manually.

Fixes a memory leak in the `getProcessExtensions` function where the `SecTask` object created by `SecTaskCreateWithAuditToken` was never released.

### Changes:

- Added null check after creating `secTask` for safety
- Added `CFRelease(secTask)` after retrieving the signing identifier to properly release the CoreFoundation object
- Added early return if `secTask` creation fails

### Testing:

The changes follow CoreFoundation memory management rules where objects returned by Create functions must be released manually.
Copilot AI review requested due to automatic review settings January 28, 2026 09:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a memory leak in the getProcessExtensions function where the SecTask object created by SecTaskCreateWithAuditToken was never released, violating CoreFoundation's memory management rules for objects returned by Create functions.

Changes:

  • Added null check and early return if SecTask creation fails
  • Added CFRelease(secTask) to properly release the CoreFoundation object after use

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant