From 58730850f93a4ed10a937c344f2f1e2f402e96d2 Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Thu, 4 Oct 2018 16:15:52 +0900 Subject: [PATCH] Fix coverity issues Change-Id: I119d2cad823217f7c69c38461d14f34dacd550dd Signed-off-by: sooyeon.kim --- src/multi_assistant_dbus.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/multi_assistant_dbus.c b/src/multi_assistant_dbus.c index 89d7940..810f359 100644 --- a/src/multi_assistant_dbus.c +++ b/src/multi_assistant_dbus.c @@ -331,6 +331,10 @@ int masc_ui_dbus_send_asr_result(int pid, int event, char* asr_result) if (1 != dbus_connection_send(g_conn_sender, msg, NULL)) { MAS_LOGE("[Dbus ERROR] Fail to Send"); + if (NULL != temp_asr_result) { + free(temp_asr_result); + temp_asr_result = NULL; + } return -1; // MAS_ERROR_OPERATION_FAILED; } else { MAS_LOGD("[Dbus DEBUG] Success to Send ASR result"); @@ -412,6 +416,12 @@ int masc_ui_dbus_send_result(int pid, const char* display_text, const char* utte if (1 != dbus_connection_send(g_conn_sender, msg, NULL)) { MAS_LOGE("[Dbus ERROR] Fail to Send"); + if (temp_display_text) + free(temp_display_text); + if (temp_utterance_text) + free(temp_utterance_text); + if (temp_result_json) + free(temp_result_json); return -1; //MA_ERROR_OPERATION_FAILED; } else { MAS_LOGD("[Dbus DEBUG] Success to Send result"); @@ -425,7 +435,7 @@ int masc_ui_dbus_send_result(int pid, const char* display_text, const char* utte if (temp_utterance_text) free(temp_utterance_text); if (temp_result_json) - free(temp_result_json); + free(temp_result_json); #endif return 0; } -- 2.7.4