Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2017-12-21 17:21:26 -0500
committerEugene Tarassov2017-12-21 17:21:26 -0500
commit1acbfd7a9acbe2c205a1ec7306b956db0ecd3db4 (patch)
treefb41ea8613d4ead2d03449af96abc550eb37029f
parent0d0b3328b65106aae54adab4924c8225ddfbf6dd (diff)
downloadorg.eclipse.tcf.agent-1acbfd7a9acbe2c205a1ec7306b956db0ecd3db4.tar.gz
org.eclipse.tcf.agent-1acbfd7a9acbe2c205a1ec7306b956db0ecd3db4.tar.xz
org.eclipse.tcf.agent-1acbfd7a9acbe2c205a1ec7306b956db0ecd3db4.zip
TCF Agent: fixed memory leak
-rw-r--r--agent/tcf/framework/cache.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/agent/tcf/framework/cache.c b/agent/tcf/framework/cache.c
index ef69621a..2d22ec22 100644
--- a/agent/tcf/framework/cache.c
+++ b/agent/tcf/framework/cache.c
@@ -112,6 +112,7 @@ static void run_cache_client(int retry) {
if (get_error_code(trap.error) != ERR_CACHE_MISS || cache_miss_cnt == 0 || current_cache == NULL) {
trace(LOG_ALWAYS, "Unhandled exception in data cache client: %s", errno_to_str(trap.error));
for (i = 0; i < listeners_cnt; i++) listeners[i](CTLE_COMMIT);
+ if (current_client.args_copy) loc_free(current_client.args);
}
else {
AbstractCache * cache = current_cache;
@@ -163,6 +164,7 @@ void cache_exit(void) {
assert(current_client.client != NULL);
if (cache_miss_cnt > 0) exception(ERR_CACHE_MISS);
for (i = 0; i < listeners_cnt; i++) listeners[i](CTLE_COMMIT);
+ if (current_client.args_copy) loc_free(current_client.args);
memset(&current_client, 0, sizeof(current_client));
current_cache = NULL;
cache_miss_cnt = 0;

Back to the top