Skip to content

Workflow::Clone leaks the workflow #7059

Open
@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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions