Skip to content

Commit

Permalink
Fix a double-free bug.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Leslie-bcy authored and thanhbnq committed May 11, 2022
1 parent 629b93c commit 6a3bd90
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/shared/dlt_config_file_parser.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6a3bd90

Please sign in to comment.