From 04c7881dae02334e5f62adc4bc4877c7f0668dd6 Mon Sep 17 00:00:00 2001 From: "wn.jang" Date: Tue, 26 Mar 2024 19:47:32 +0900 Subject: [PATCH] Fix defects detected by static analysis tool Change-Id: I01dde7df1ef09cf267414363cd4de0283760e5a5 --- client/vc_setting_tidl.c | 1 + client/vc_tidl.c | 2 ++ client/vc_widget.c | 3 +++ 3 files changed, 6 insertions(+) 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 !!"); -- 2.34.1