From 6a3bd901d825c7206797e36ea98e10a218f5aad2 Mon Sep 17 00:00:00 2001 From: Safe-BCY <512234783@qq.com> Date: Thu, 5 May 2022 06:47:17 +0800 Subject: 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 --- src/shared/dlt_config_file_parser.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') 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; } -- cgit v1.2.1