diff options
author | Eugene Tarassov | 2012-06-06 17:40:24 +0000 |
---|---|---|
committer | Eugene Tarassov | 2012-06-06 17:40:24 +0000 |
commit | 330b1c76b1703d4e932cf9d5d98753fc8ba154fd (patch) | |
tree | 87e4542863055c081400eb03cdf12455c9d71bc9 | |
parent | 3cba20fcabf833abfb83572cd5b1405880151268 (diff) | |
download | org.eclipse.tcf.agent-330b1c76b1703d4e932cf9d5d98753fc8ba154fd.tar.gz org.eclipse.tcf.agent-330b1c76b1703d4e932cf9d5d98753fc8ba154fd.tar.xz org.eclipse.tcf.agent-330b1c76b1703d4e932cf9d5d98753fc8ba154fd.zip |
TCF Agent: fixed a memory leak
-rw-r--r-- | agent/tcf/services/symbols_proxy.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/agent/tcf/services/symbols_proxy.c b/agent/tcf/services/symbols_proxy.c index ee164afe..03996ada 100644 --- a/agent/tcf/services/symbols_proxy.c +++ b/agent/tcf/services/symbols_proxy.c @@ -303,13 +303,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); } } @@ -334,10 +336,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); } |