diff options
author | Safe-BCY <512234783@qq.com> | 2022-05-05 06:47:17 +0800 |
---|---|---|
committer | Bui Nguyen Quoc Thanh <49302843+thanhbnq@users.noreply.github.com> | 2022-05-11 10:56:49 +0700 |
commit | 6a3bd901d825c7206797e36ea98e10a218f5aad2 (patch) | |
tree | e3c423075ae35685697f647a4d73b5ffdb281959 | |
parent | 629b93c9d3f81a184efe1e5b97672da9b55b35c9 (diff) | |
download | DLT-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>
-rw-r--r-- | src/shared/dlt_config_file_parser.c | 1 |
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; } |