Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2012-06-06 13:40:24 -0400
committerEugene Tarassov2012-06-07 20:25:29 -0400
commitfecc0dbf13aa6f246c6139f3255088974001784f (patch)
treed2b8071fa0440cc5bbcdeeac9f5551282b9b5b91
parent3989f288dd1c08263cd99e6b68b8d53221447422 (diff)
downloadorg.eclipse.tcf.agent-1.0.tar.gz
org.eclipse.tcf.agent-1.0.tar.xz
org.eclipse.tcf.agent-1.0.zip
TCF Agent: fixed a memory leak1.0
-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