Fix defects detected by static analysis tool 98/308498/1 accepted/tizen_unified_dev accepted/tizen/unified/20240327.064216 accepted/tizen/unified/dev/20240620.010405 accepted/tizen/unified/x/20240401.142503
authorwn.jang <wn.jang@samsung.com>
Tue, 26 Mar 2024 10:47:32 +0000 (19:47 +0900)
committerTizen AI <ai.tzn.sec@samsung.com>
Tue, 26 Mar 2024 11:14:02 +0000 (20:14 +0900)
Change-Id: I01dde7df1ef09cf267414363cd4de0283760e5a5

client/vc_setting_tidl.c
client/vc_tidl.c
client/vc_widget.c

index 98080202706cb74b863425422858101710a80400..6771ec36ab999ca321c572cf10ae0b5cef22c973 100644 (file)
@@ -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;
        }
 
index 5985b3ed8ef242ebee8eb22ad3d115e3411b5562..a9d968b4b84b02dcb3404fd5a3611a0d6fa49b46 100644 (file)
@@ -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;
        }
index 19d147338c7d0062b42ba4fa56b8556007c8859d..4c33a013c348f8803f3979e6c447fdf68c6b9417 100644 (file)
@@ -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 !!");