diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 101b0f214..d0cf1473a 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -4258,6 +4258,8 @@ static int riscv_openocd_step_impl(struct target *target, bool current, LOG_TARGET_ERROR(target, "Failed to re-enable watchpoints " "after single-step."); } + free(wps_to_enable); + //no longer needed to be kept if (breakpoint && (riscv_add_breakpoint(target, breakpoint) != ERROR_OK)) { success = false;