Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2015-08-12 15:20:55 -0400
committerEugene Tarassov2015-08-12 15:20:55 -0400
commit827dbc0c3b5c2d64e1eca138ba2d2205a3db86fa (patch)
treef3bada4b9206c32e8b39cbb224146151ee319798
parente894c9d4e3b4aea5c4dc9b3b5de7e304c48f20f3 (diff)
downloadorg.eclipse.tcf.agent-827dbc0c3b5c2d64e1eca138ba2d2205a3db86fa.tar.gz
org.eclipse.tcf.agent-827dbc0c3b5c2d64e1eca138ba2d2205a3db86fa.tar.xz
org.eclipse.tcf.agent-827dbc0c3b5c2d64e1eca138ba2d2205a3db86fa.zip
TCF Server: fixed memory leak
-rw-r--r--server/tcf/services/context-proxy.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/server/tcf/services/context-proxy.c b/server/tcf/services/context-proxy.c
index a2383aea..699637a4 100644
--- a/server/tcf/services/context-proxy.c
+++ b/server/tcf/services/context-proxy.c
@@ -1399,6 +1399,20 @@ static void read_memory_map_item(InputStream * inp, void * args) {
mem_buf_pos++;
}
}
+ if (m == mem_buf + mem_buf_pos) {
+ /* Unused entry, need to free memory */
+ loc_free(m->file_name);
+ loc_free(m->sect_name);
+ loc_free(m->query);
+ loc_free(m->id);
+ while (m->attrs != NULL) {
+ MemoryRegionAttribute * x = m->attrs;
+ m->attrs = x->next;
+ loc_free(x->name);
+ loc_free(x->value);
+ loc_free(x);
+ }
+ }
}
static void validate_memory_map_cache(Channel * c, void * args, int error) {

Back to the top