Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--agent/tcf/services/symbols_proxy.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/agent/tcf/services/symbols_proxy.c b/agent/tcf/services/symbols_proxy.c
index 4daa203f..1c37326b 100644
--- a/agent/tcf/services/symbols_proxy.c
+++ b/agent/tcf/services/symbols_proxy.c
@@ -294,13 +294,15 @@ static void free_find_sym_cache(FindSymCache * c) {
}
}
+static void free_location_command_args(LocationExpressionCommand * cmd) {
+ if (cmd->cmd == SFT_CMD_LOCATION) loc_free(cmd->args.loc.code_addr);
+ else if (cmd->cmd == SFT_CMD_PIECE) loc_free(cmd->args.piece.value);
+}
+
static void free_sft_sequence(StackFrameRegisterLocation * seq) {
if (seq != NULL) {
unsigned i = 0;
- while (i < seq->cmds_cnt) {
- LocationExpressionCommand * cmd = seq->cmds + i++;
- if (cmd->cmd == SFT_CMD_LOCATION) loc_free(cmd->args.loc.code_addr);
- }
+ while (i < seq->cmds_cnt) free_location_command_args(seq->cmds + i++);
loc_free(seq);
}
}
@@ -322,10 +324,7 @@ static void free_stack_frame_cache(StackFrameCache * c) {
static void free_location_commands(LocationCommands * cmds) {
unsigned i = 0;
- while (i < cmds->cnt) {
- LocationExpressionCommand * cmd = cmds->cmds + i++;
- if (cmd->cmd == SFT_CMD_LOCATION) loc_free(cmd->args.loc.code_addr);
- }
+ while (i < cmds->cnt) free_location_command_args(cmds->cmds + i++);
loc_free(cmds->cmds);
}

Back to the top