Skip to content

Commit 6a3bd90

Browse files
Leslie-bcythanhbnq
authored andcommitted
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 <[email protected]>
1 parent 629b93c commit 6a3bd90

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/shared/dlt_config_file_parser.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ static int dlt_config_file_set_section(DltConfigFile *file, char *name)
148148

149149
if (s->keys == NULL) {
150150
free(s->name);
151+
s->name = NULL;
151152
dlt_log(LOG_ERR, "Cannot allocate memory for internal data structure\n");
152153
return -1;
153154
}

0 commit comments

Comments
 (0)