Skip to content

Commit

Permalink
Merge pull request #698 from averater/fix_undefined_free_string_litteral
Browse files Browse the repository at this point in the history
Remove free of string litteral
  • Loading branch information
lti9hc authored Nov 6, 2024
2 parents 2a45146 + a6e343a commit 348cc5f
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/offlinelogstorage/dlt_offline_logstorage_behavior.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,15 +370,9 @@ int dlt_logstorage_storage_dir_info(DltLogStorageUserConfig *file_config,
config->records = NULL;
}

char* suffix = NULL;
for (i = 0; i < cnt; i++) {
if (config->gzip_compression) {
suffix = strdup(".dlt.gz");
}
else {
suffix = strdup(".dlt");
}
char *suffix = config->gzip_compression ? ".dlt.gz" : ".dlt";

for (i = 0; i < cnt; i++) {
int len = 0;
len = strlen(file_name);

Expand Down Expand Up @@ -470,11 +464,6 @@ int dlt_logstorage_storage_dir_info(DltLogStorageUserConfig *file_config,

free(files);

if (suffix) {
free(suffix);
suffix = NULL;
}

return ret;
}

Expand Down

0 comments on commit 348cc5f

Please sign in to comment.