Skip to content

Memory leak in riscv_openocd_step_impl() #1284

@en-sc

Description

@en-sc

As reported by Marc Schink in https://review.openocd.org/c/openocd/+/8893/comments/4fc4226b_3a8c92bb there is a leak in riscv_openocd_step_impl():

The leak was introduced in commit 5a8697b ("target/riscv: manage triggers available to OpenOCD for internal use"). I don't quite understand how we have missed it during the review of #1111

The RISC-V Debug Tests should have caught it when run under Valgrind/Address Sanitizer.

The task is twofold:

  1. Implement a fix.
  2. Investigate why the bug was missed during testing. Adjust the testsuite if needed.

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