summaryrefslogtreecommitdiff
path: root/src/target/breakpoints.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/target/breakpoints.c')
-rw-r--r--src/target/breakpoints.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/target/breakpoints.c b/src/target/breakpoints.c
index 8b140b3e..ac8d7dfd 100644
--- a/src/target/breakpoints.c
+++ b/src/target/breakpoints.c
@@ -71,13 +71,15 @@ int breakpoint_add(target_t *target, u32 address, u32 length, enum breakpoint_ty
{
case ERROR_TARGET_RESOURCE_NOT_AVAILABLE:
INFO("can't add %s breakpoint, resource not available", breakpoint_type_strings[(*breakpoint_p)->type]);
- free (*breakpoint_p);
+ free((*breakpoint_p)->orig_instr);
+ free(*breakpoint_p);
*breakpoint_p = NULL;
return retval;
break;
case ERROR_TARGET_NOT_HALTED:
INFO("can't add breakpoint while target is running");
- free (*breakpoint_p);
+ free((*breakpoint_p)->orig_instr);
+ free(*breakpoint_p);
*breakpoint_p = NULL;
return retval;
break;