diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/console/dlt-control-common.c | 2 | ||||
-rw-r--r-- | src/shared/dlt_common.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/console/dlt-control-common.c b/src/console/dlt-control-common.c index abcaf92..64951c1 100644 --- a/src/console/dlt-control-common.c +++ b/src/console/dlt-control-common.c @@ -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 { diff --git a/src/shared/dlt_common.c b/src/shared/dlt_common.c index 6737251..97766f7 100644 --- a/src/shared/dlt_common.c +++ b/src/shared/dlt_common.c @@ -1718,7 +1718,7 @@ DltReturnValue dlt_file_message(DltFile *file, int index, int verbose) return DLT_RETURN_WRONG_PARAMETER; /* check if message is in range */ - if (index >= file->counter) { + if (index < 0 || index >= file->counter) { dlt_vlog(LOG_WARNING, "Message %d out of range!\r\n", index); return DLT_RETURN_WRONG_PARAMETER; } |