From c32b3a39e484c1fc5ff625c752c6beeb9426ff85 Mon Sep 17 00:00:00 2001 From: Saya Sugiura Date: Fri, 7 Jun 2019 17:02:18 +0900 Subject: Correct sa findings dlt_offline_logstorage.c - Parameter to isdigit is not correct - Handle the size of memset() and strncpy() properly dlt-test-stress-user.c - Parameter d is duplicated dlt_env_ll.c - Parameter env is used before NULL check - Remove redundant line dlt-control-common.c dlt_daemon_event_handler.c - Do not use NULL variable to print log dlt_config_file_parser.c - Remove unnecessary loop dlt_daemon_client.c - Return error in NULL check dlt_user.c - Free allocated memory in error case Related commit: 5c8f88d logstorage: fix compile error Signed-off-by: Saya Sugiura --- src/lib/dlt_user.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib/dlt_user.c') diff --git a/src/lib/dlt_user.c b/src/lib/dlt_user.c index d603783..d040d38 100644 --- a/src/lib/dlt_user.c +++ b/src/lib/dlt_user.c @@ -3205,8 +3205,10 @@ DltReturnValue dlt_log_raw(DltContext *handle, DltLogLevelType loglevel, void *d return DLT_RETURN_WRONG_PARAMETER; if (dlt_user_log_write_start(handle, &log, loglevel) > 0) { - if ((ret = dlt_user_log_write_raw(&log, data, length)) < DLT_RETURN_OK) + if ((ret = dlt_user_log_write_raw(&log, data, length)) < DLT_RETURN_OK) { + dlt_user_free_buffer(&(log.buffer)); return ret; + } if (dlt_user_log_write_finish(&log) < DLT_RETURN_OK) return DLT_RETURN_ERROR; -- cgit v1.2.1