From: wn.jang Date: Tue, 26 Mar 2024 10:47:32 +0000 (+0900) Subject: Fix defects detected by static analysis tool X-Git-Tag: accepted/tizen/unified/20240327.064216^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_unified_dev;p=platform%2Fcore%2Fuifw%2Fvoice-control.git Fix defects detected by static analysis tool Change-Id: I01dde7df1ef09cf267414363cd4de0283760e5a5 --- diff --git a/client/vc_setting_tidl.c b/client/vc_setting_tidl.c index 9808020..6771ec3 100644 --- a/client/vc_setting_tidl.c +++ b/client/vc_setting_tidl.c @@ -228,6 +228,7 @@ int vc_setting_tidl_open_connection() char* engine_appid = __get_engine_appid(); if (NULL == engine_appid) { SLOG(LOG_ERROR, TAG_VCC, "[TIDL ERROR] Fail to get engine appid"); + free(info); return VC_ERROR_OUT_OF_MEMORY; } diff --git a/client/vc_tidl.c b/client/vc_tidl.c index 5985b3e..a9d968b 100644 --- a/client/vc_tidl.c +++ b/client/vc_tidl.c @@ -375,12 +375,14 @@ int vc_tidl_open_connection() info->engine_appid = __get_engine_appid(); if (NULL == info->engine_appid) { SLOG(LOG_ERROR, TAG_VCC, "[TIDL ERROR] Fail to get engine appid"); + free(info); return VC_ERROR_OUT_OF_MEMORY; } info->rpc_h = __create_rpc_port(pid, info->engine_appid); if (NULL == info->rpc_h) { SLOG(LOG_ERROR, TAG_VCC, "[TIDL ERROR] Fail to create proxy"); + free(info->engine_appid); free(info); return VC_ERROR_OPERATION_FAILED; } diff --git a/client/vc_widget.c b/client/vc_widget.c index 19d1473..4c33a01 100644 --- a/client/vc_widget.c +++ b/client/vc_widget.c @@ -547,12 +547,15 @@ static void __start_prepare_thread(void *data, Ecore_Thread *thread) ret = -1; retry_count = 0; while (0 != ret) { + pthread_mutex_lock(&g_w_init_mutex); if (g_ask_to_cancel_preparing) { SLOG(LOG_WARN, TAG_VCW, "[WARNING] Thread is canceled."); ecore_main_loop_thread_safe_call_async(__vc_widget_delete_focus_event_handler, NULL); g_w_prepare_thread = NULL; + pthread_mutex_unlock(&g_w_init_mutex); return; } + pthread_mutex_unlock(&g_w_init_mutex); if (retry_count == 10) { SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to connect daemon !!");