diff options
author | Yusuke Sato <yusuke-sato@apn.alpine.co.jp> | 2016-03-04 17:11:08 +0100 |
---|---|---|
committer | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2016-09-23 15:37:26 +0200 |
commit | e1d7cba3c9a1bc764313e6eb0ae42a5af0881ac2 (patch) | |
tree | 814fb286dd521d594245267eabe41dcd8c4fa544 /src/lib | |
parent | 12ced8236628c8a5bd317c5605f970d4cde73bd1 (diff) | |
download | DLT-daemon-e1d7cba3c9a1bc764313e6eb0ae42a5af0881ac2.tar.gz |
Fix: Memory for context description is not freed
Currently, allocated memory for context description is not freed in dlt_free().
free() for each member variables of dlt_user.dlt_ll_ts[i] is added in the for block in dlt_free().
Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
Change-Id: I52a81cf2918cb0014fdcfc666cb8bb93ca7cb525
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/dlt_user.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/dlt_user.c b/src/lib/dlt_user.c index 917d457..9870cf2 100644 --- a/src/lib/dlt_user.c +++ b/src/lib/dlt_user.c @@ -669,6 +669,24 @@ DltReturnValue dlt_free(void) { for (i=0;i<dlt_user.dlt_ll_ts_max_num_entries;i++) { + if( dlt_user.dlt_ll_ts[i].context_description != NULL) + { + free (dlt_user.dlt_ll_ts[i].context_description); + dlt_user.dlt_ll_ts[i].context_description = NULL; + } + + if (dlt_user.dlt_ll_ts[i].log_level_ptr != NULL) + { + free(dlt_user.dlt_ll_ts[i].log_level_ptr); + dlt_user.dlt_ll_ts[i].log_level_ptr = NULL; + } + + if (dlt_user.dlt_ll_ts[i].trace_status_ptr != NULL) + { + free(dlt_user.dlt_ll_ts[i].trace_status_ptr); + dlt_user.dlt_ll_ts[i].trace_status_ptr = NULL; + } + if (dlt_user.dlt_ll_ts[i].injection_table != NULL) { free(dlt_user.dlt_ll_ts[i].injection_table); |