summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSafe-BCY <512234783@qq.com>2022-05-05 06:47:17 +0800
committerBui Nguyen Quoc Thanh <49302843+thanhbnq@users.noreply.github.com>2022-05-11 10:56:49 +0700
commit6a3bd901d825c7206797e36ea98e10a218f5aad2 (patch)
treee3c423075ae35685697f647a4d73b5ffdb281959 /src
parent629b93c9d3f81a184efe1e5b97672da9b55b35c9 (diff)
downloadDLT-daemon-6a3bd901d825c7206797e36ea98e10a218f5aad2.tar.gz
Fix a double-free bug.
In the dlt_config_file_set_section function of dlt_config_file_parser.c: s-name is not set to null after free. It will be freed again in the dlt_config_file_release function. Signed-off-by: Zhongyang.Bao <Zhongyang.Bao@zeekrlife.com>
Diffstat (limited to 'src')
-rw-r--r--src/shared/dlt_config_file_parser.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/shared/dlt_config_file_parser.c b/src/shared/dlt_config_file_parser.c
index 009a093..fc2d516 100644
--- a/src/shared/dlt_config_file_parser.c
+++ b/src/shared/dlt_config_file_parser.c
@@ -148,6 +148,7 @@ static int dlt_config_file_set_section(DltConfigFile *file, char *name)
if (s->keys == NULL) {
free(s->name);
+ s->name = NULL;
dlt_log(LOG_ERR, "Cannot allocate memory for internal data structure\n");
return -1;
}