Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leak #441

Merged
merged 1 commit into from
Feb 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix memory leak
Free the ecuid_conf in case of memory alllocated

Signed-off-by: Le Van Khanh <Khanh.LeVan@vn.bosch.com>
  • Loading branch information
lvklevankhanh committed Feb 9, 2023
commit b6149e203f919c899fefc702a17fbb78bdec3700
2 changes: 2 additions & 0 deletions src/console/dlt-control-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ void set_ecuid(char *ecuid)
if (dlt_parse_config_param("ECUId", &ecuid_conf) == 0) {
memset(local_ecuid, 0, DLT_CTRL_ECUID_LEN);
strncpy(local_ecuid, ecuid_conf, DLT_CTRL_ECUID_LEN);
if (ecuid_conf !=NULL)
free(ecuid_conf);
local_ecuid[DLT_CTRL_ECUID_LEN - 1] = '\0';
}
else {
Expand Down