Skip to content

Workflow::Clone leaks the workflow #7059

@bdash

Description

@bdash

Version and Platform (required):

  • Binary Ninja Version: 5.1.7870-dev
  • OS: macOS 15.5
  • CPU Architecture: arm64

Bug Description:
Workflow::Clone passes the result of BNWorkflowClone into Workflow::Workflow which then calls BNNewWorkflowReference. Since BNWorkflowClone returns a +1 object, this results in an extra ref on the object that is leaked.

It looks like other C++ API types take ownership of the BNFoo* object that is passed to them rather than adding an additional reference. I haven't looked at clients of Workflow to determine whether that change is safe to make.

Steps To Reproduce:
I found this by doing:

  1. MallocStackLoggingNoCompact=YES /path/to/binaryninja.app/Contents/MacOS/binaryninja
  2. leaks binaryninja

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CoreIssue needs changes to the coreCore: WorkflowIssue involves the workflow systemEffort: TrivialIssues require < 1 day of workImpact: LowIssue is a papercut or has a good, supported workaround

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions