Fix Memory leak / Change log level of 'vcinfo' logs. 22/105622/2
authorSuyeon Hwang <stom.hwang@samsung.com>
Mon, 19 Dec 2016 06:34:24 +0000 (15:34 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Mon, 19 Dec 2016 06:41:23 +0000 (22:41 -0800)
Change-Id: Ic0bf404adaa3defa609cc0e75f54b758d95e8439
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
common/vc_config_mgr.c
common/vc_config_parser.c
common/vc_info_parser.c
common/vc_json_parser.c
server/vcd_server.c

index 822f81d..b82940e 100644 (file)
@@ -145,7 +145,7 @@ int __vc_config_mgr_check_engine_is_valid(const char* engine_id)
 
        SLOG(LOG_DEBUG, vc_config_tag(), "Default engine is changed : %s", g_config_info->engine_id);
        if (0 != vc_parser_set_engine(g_config_info->engine_id)) {
-               SLOG(LOG_ERROR, vc_config_tag(), " Fail to save config");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Fail to save config");
                return -1;
        }
 
@@ -233,7 +233,7 @@ int __vc_config_mgr_select_lang(const char* engine_id, char** language)
                engine_info = iter->data;
 
                if (NULL == engine_info) {
-                       SLOG(LOG_ERROR, vc_config_tag(), "engine info is NULL");
+                       SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] engine info is NULL");
                        return false;
                }
 
@@ -382,13 +382,13 @@ int __vc_config_set_auto_language()
 
        /* Check current config info */
        if (NULL == g_config_info) {
-               SLOG(LOG_ERROR, vc_config_tag(), "Current config info is NULL");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Current config info is NULL");
                return VC_CONFIG_ERROR_OPERATION_FAILED;
        }
 
        /* Check current language */
        if (NULL == g_config_info->language) {
-               SLOG(LOG_ERROR, vc_config_tag(), "Current config language is NULL");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Current config language is NULL");
                return VC_CONFIG_ERROR_OPERATION_FAILED;
        }
 
@@ -401,7 +401,7 @@ int __vc_config_set_auto_language()
                /* vc default language change */
                char* before_lang = NULL;
                if (0 != vc_parser_set_language(candidate_lang)) {
-                       SLOG(LOG_ERROR, vc_config_tag(), "Fail to save default language");
+                       SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Fail to save default language");
                        return -1;
                }
 
@@ -840,7 +840,7 @@ int vc_config_mgr_unset_lang_cb(int uid)
 int vc_config_mgr_set_enabled_cb(int uid, vc_config_enabled_cb enabled_cb)
 {
        if (NULL == enabled_cb) {
-               SLOG(LOG_ERROR, vc_config_tag(), "enabled cb is NULL : uid(%d) ", uid);
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] enabled cb is NULL : uid(%d) ", uid);
                return VC_CONFIG_ERROR_INVALID_PARAMETER;
        }
 
@@ -891,7 +891,7 @@ int vc_config_mgr_unset_enabled_cb(int uid)
 int vc_config_mgr_get_auto_language(bool* value)
 {
        if (0 >= g_slist_length(g_config_client_list)) {
-               SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
                return -1;
        }
 
@@ -907,14 +907,14 @@ int vc_config_mgr_get_auto_language(bool* value)
 int vc_config_mgr_set_auto_language(bool value)
 {
        if (0 >= g_slist_length(g_config_client_list)) {
-               SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
                return -1;
        }
 
        if (g_config_info->auto_lang != value) {
                /* Check language is valid */
                if (0 != vc_parser_set_auto_lang(value)) {
-                       SLOG(LOG_ERROR, vc_config_tag(), "Fail to save engine id");
+                       SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Fail to save engine id");
                        return -1;
                }
                g_config_info->auto_lang = value;
@@ -930,12 +930,12 @@ int vc_config_mgr_set_auto_language(bool value)
 int vc_config_mgr_get_language_list(vc_supported_language_cb callback, void* user_data)
 {
        if (0 >= g_slist_length(g_config_client_list)) {
-               SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
                return -1;
        }
 
        if (0 >= g_slist_length(g_engine_list)) {
-               SLOG(LOG_ERROR, vc_config_tag(), "There is no engine");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] There is no engine");
                return -1;
        }
 
@@ -986,7 +986,7 @@ int vc_config_mgr_get_language_list(vc_supported_language_cb callback, void* use
 int vc_config_mgr_get_default_language(char** language)
 {
        if (0 >= g_slist_length(g_config_client_list)) {
-               SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
                return -1;
        }
 
@@ -997,7 +997,7 @@ int vc_config_mgr_get_default_language(char** language)
        if (NULL != g_config_info->language) {
                *language = strdup(g_config_info->language);
        } else {
-               SLOG(LOG_ERROR, vc_config_tag(), " language is NULL");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] language is NULL");
                return -1;
        }
 
@@ -1007,7 +1007,7 @@ int vc_config_mgr_get_default_language(char** language)
 int vc_config_mgr_set_default_language(const char* language)
 {
        if (0 >= g_slist_length(g_config_client_list)) {
-               SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
                return -1;
        }
 
@@ -1018,13 +1018,13 @@ int vc_config_mgr_set_default_language(const char* language)
        /* Check language is valid */
        if (NULL != g_config_info->language) {
                if (0 != vc_parser_set_language(language)) {
-                       SLOG(LOG_ERROR, vc_config_tag(), "Fail to save engine id");
+                       SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Fail to save engine id");
                        return -1;
                }
                free(g_config_info->language);
                g_config_info->language = strdup(language);
        } else {
-               SLOG(LOG_ERROR, vc_config_tag(), " language is NULL");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] language is NULL");
                return -1;
        }
 
@@ -1034,7 +1034,7 @@ int vc_config_mgr_set_default_language(const char* language)
 int vc_config_mgr_get_enabled(bool* value)
 {
        if (0 >= g_slist_length(g_config_client_list)) {
-               SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
                return -1;
        }
 
@@ -1050,12 +1050,12 @@ int vc_config_mgr_get_enabled(bool* value)
 int vc_config_mgr_set_enabled(bool value)
 {
        if (0 >= g_slist_length(g_config_client_list)) {
-               SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
                return -1;
        }
 
        if (0 != vc_parser_set_enabled(value)) {
-               SLOG(LOG_ERROR, vc_config_tag(), "Fail to set enabled");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Fail to set enabled");
                return -1;
        }
 
@@ -1067,17 +1067,17 @@ int vc_config_mgr_set_enabled(bool value)
 int vc_config_mgr_get_nonfixed_support(bool* value)
 {
        if (0 >= g_slist_length(g_config_client_list)) {
-               SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
                return -1;
        }
 
        if (NULL == value) {
-               SLOG(LOG_ERROR, vc_config_tag(), "Input parameter is NULL");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Input parameter is NULL");
                return -1;
        }
 
        if (0 >= g_slist_length(g_engine_list)) {
-               SLOG(LOG_ERROR, vc_config_tag(), "There is no engine");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] There is no engine");
                return -1;
        }
 
@@ -1111,7 +1111,7 @@ int vc_config_mgr_get_nonfixed_support(bool* value)
 bool vc_config_check_default_engine_is_valid(const char* engine)
 {
        if (0 >= g_slist_length(g_config_client_list)) {
-               SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
                return -1;
        }
 
@@ -1145,7 +1145,7 @@ bool vc_config_check_default_engine_is_valid(const char* engine)
 bool vc_config_check_default_language_is_valid(const char* language)
 {
        if (0 >= g_slist_length(g_config_client_list)) {
-               SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
                return -1;
        }
 
@@ -1205,7 +1205,7 @@ bool vc_config_check_default_language_is_valid(const char* language)
 int vc_config_mgr_set_foreground(int pid, bool value)
 {
        if (0 >= g_slist_length(g_config_client_list)) {
-               SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
                return -1;
        }
 
@@ -1215,7 +1215,7 @@ int vc_config_mgr_set_foreground(int pid, bool value)
 int vc_config_mgr_get_foreground(int* pid)
 {
        if (0 >= g_slist_length(g_config_client_list)) {
-               SLOG(LOG_ERROR, vc_config_tag(), "Not initialized");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
                return -1;
        }
 
@@ -1269,7 +1269,7 @@ int __vc_config_mgr_print_engine_info()
                                j++;
                        }
                } else {
-                       SLOG(LOG_ERROR, vc_config_tag(), "  language is NONE");
+                       SLOG(LOG_DEBUG, vc_config_tag(), "  language is NONE");
                }
                SLOG(LOG_DEBUG, vc_config_tag(), " ");
                iter = g_slist_next(iter);
@@ -1309,4 +1309,4 @@ int __vc_config_mgr_print_client_info()
        SLOG(LOG_DEBUG, vc_config_tag(), "--------------------------------------------");
 
        return 0;
-}
+}
\ No newline at end of file
index f4c3456..92ca095 100644 (file)
@@ -128,7 +128,7 @@ int vc_parser_get_engine_info(const char* path, vc_engine_info_s** engine_info)
                                temp->name = strdup((char*)key);
                                xmlFree(key);
                        } else {
-                               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] <%s> has no content", VC_TAG_ENGINE_ID);
+                               SLOG(LOG_WARN, vc_config_tag(), "[WARNING] <%s> has no content", VC_TAG_ENGINE_ID);
                        }
                } else if (0 == xmlStrcmp(cur->name, (const xmlChar *)VC_TAG_ENGINE_ID)) {
                        key = xmlNodeGetContent(cur);
@@ -138,7 +138,7 @@ int vc_parser_get_engine_info(const char* path, vc_engine_info_s** engine_info)
                                temp->uuid = strdup((char*)key);
                                xmlFree(key);
                        } else {
-                               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] <%s> has no content", VC_TAG_ENGINE_ID);
+                               SLOG(LOG_WARN, vc_config_tag(), "[WARNING] <%s> has no content", VC_TAG_ENGINE_ID);
                        }
                } else if (0 == xmlStrcmp(cur->name, (const xmlChar *)VC_TAG_ENGINE_LANGUAGE_SET)) {
                        xmlNodePtr lang_node = NULL;
@@ -155,7 +155,7 @@ int vc_parser_get_engine_info(const char* path, vc_engine_info_s** engine_info)
                                                temp->languages = g_slist_append(temp->languages, temp_lang);
                                                xmlFree(key);
                                        } else {
-                                               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] <%s> has no content", VC_TAG_ENGINE_LANGUAGE);
+                                               SLOG(LOG_WARN, vc_config_tag(), "[WARNING] <%s> has no content", VC_TAG_ENGINE_LANGUAGE);
                                        }
                                }
 
@@ -171,12 +171,12 @@ int vc_parser_get_engine_info(const char* path, vc_engine_info_s** engine_info)
                                } else if (0 == xmlStrcmp(key, (const xmlChar *)"false")) {
                                        temp->non_fixed_support = false;
                                } else {
-                                       SLOG(LOG_ERROR, vc_config_tag(), "Auto voice is wrong");
+                                       SLOG(LOG_WARN, vc_config_tag(), "[WARNING] Auto voice is wrong");
                                        temp->non_fixed_support = false;
                                }
                                xmlFree(key);
                        } else {
-                               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] <%s> has no content", VC_TAG_ENGINE_NON_FIXED_SUPPORT);
+                               SLOG(LOG_WARN, vc_config_tag(), "[WARNING] <%s> has no content", VC_TAG_ENGINE_NON_FIXED_SUPPORT);
                        }
                } else {
 
@@ -257,7 +257,7 @@ int vc_parser_print_engine_info(vc_engine_info_s* engine_info)
                        i++;
                }
        } else {
-               SLOG(LOG_ERROR, vc_config_tag(), "  language is NONE");
+               SLOG(LOG_DEBUG, vc_config_tag(), "  language is NONE");
        }
        SLOG(LOG_DEBUG, vc_config_tag(), "=====================");
 
@@ -343,7 +343,7 @@ int vc_parser_load_config(vc_config_s** config_info)
                                temp->engine_id = strdup((char*)key);
                                xmlFree(key);
                        } else {
-                               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] enable is NULL");
+                               SLOG(LOG_WARN, vc_config_tag(), "[WARNING] enable is NULL");
                        }
                } else if (0 == xmlStrcmp(cur->name, (const xmlChar *)VC_TAG_CONFIG_AUTO_LANGUAGE)) {
                        key = xmlNodeGetContent(cur);
@@ -355,13 +355,13 @@ int vc_parser_load_config(vc_config_s** config_info)
                                } else if (0 == xmlStrcmp(key, (const xmlChar *)"off")) {
                                        temp->auto_lang = false;
                                } else {
-                                       SLOG(LOG_ERROR, vc_config_tag(), "Auto voice is wrong");
+                                       SLOG(LOG_WARN, vc_config_tag(), "[WARNING] Auto voice is wrong");
                                        temp->auto_lang = false;
                                }
 
                                xmlFree(key);
                        } else {
-                               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] voice type is NULL");
+                               SLOG(LOG_WARN, vc_config_tag(), "[WARNING] voice type is NULL");
                        }
                } else if (0 == xmlStrcmp(cur->name, (const xmlChar *)VC_TAG_CONFIG_LANGUAGE)) {
                        key = xmlNodeGetContent(cur);
@@ -371,7 +371,7 @@ int vc_parser_load_config(vc_config_s** config_info)
                                temp->language = strdup((char*)key);
                                xmlFree(key);
                        } else {
-                               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] language is NULL");
+                               SLOG(LOG_WARN, vc_config_tag(), "[WARNING] language is NULL");
                        }
                } else if (0 == xmlStrcmp(cur->name, (const xmlChar*)VC_TAG_CONFIG_ENABLED)) {
                        key = xmlNodeGetContent(cur);
@@ -383,11 +383,11 @@ int vc_parser_load_config(vc_config_s** config_info)
                                } else if (0 == xmlStrcmp(key, (const xmlChar *)"off")) {
                                        temp->enabled = false;
                                } else {
-                                       SLOG(LOG_ERROR, vc_config_tag(), "Enabled service is wrong");
+                                       SLOG(LOG_WARN, vc_config_tag(), "[WARNING] Enabled service is wrong");
                                        temp->enabled = false;
                                }
                        } else {
-                               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Enabled service is NULL");
+                               SLOG(LOG_WARN, vc_config_tag(), "[WARNING] Enabled service is NULL");
                        }
                } else {
 
@@ -656,7 +656,7 @@ int vc_parser_find_config_changed(int* auto_lang, char** language, int* enabled)
                                        xmlFree(key_old);
                                }
                        } else {
-                               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Old config and new config are different");
+                               SLOG(LOG_WARN, vc_config_tag(), "[WARNING] Old config and new config are different");
                        }
                } else if (0 == xmlStrcmp(cur_new->name, (const xmlChar*)VC_TAG_CONFIG_LANGUAGE)) {
                        if (0 == xmlStrcmp(cur_old->name, (const xmlChar*)VC_TAG_CONFIG_LANGUAGE)) {
@@ -674,7 +674,7 @@ int vc_parser_find_config_changed(int* auto_lang, char** language, int* enabled)
                                        xmlFree(key_old);
                                }
                        } else {
-                               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] old config and new config are different");
+                               SLOG(LOG_WARN, vc_config_tag(), "[WARNING] old config and new config are different");
                        }
                } else if (0 == xmlStrcmp(cur_new->name, (const xmlChar*)VC_TAG_CONFIG_ENABLED)) {
                        if (0 == xmlStrcmp(cur_old->name, (const xmlChar*)VC_TAG_CONFIG_ENABLED)) {
@@ -695,7 +695,7 @@ int vc_parser_find_config_changed(int* auto_lang, char** language, int* enabled)
                                        xmlFree(key_old);
                                }
                        } else {
-                               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] old config and new config are different");
+                               SLOG(LOG_WARN, vc_config_tag(), "[WARNING] old config and new config are different");
                        }
                } else {
 
@@ -716,7 +716,7 @@ int vc_parser_set_foreground(int pid, bool value)
        int cur_pid = 0;
        /* Get foreground pid */
        if (0 != vc_parser_get_foreground(&cur_pid)) {
-               SLOG(LOG_DEBUG, vc_config_tag(), "Fail to get pid from info file");
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Fail to get pid from info file");
                return -1;
        }
 
@@ -759,17 +759,20 @@ int vc_parser_set_foreground(int pid, bool value)
        cur = xmlDocGetRootElement(doc);
        if (cur == NULL) {
                SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Empty document");
+               xmlFreeDoc(doc);
                return -1;
        }
 
        if (xmlStrcmp(cur->name, (const xmlChar *) VC_TAG_INFO_BASE_TAG)) {
                SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] The wrong type, root node is NOT %s", VC_TAG_INFO_BASE_TAG);
+               xmlFreeDoc(doc);
                return -1;
        }
 
        cur = cur->xmlChildrenNode;
        if (cur == NULL) {
                SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Empty document");
+               xmlFreeDoc(doc);
                return -1;
        }
 
@@ -792,10 +795,12 @@ int vc_parser_set_foreground(int pid, bool value)
 
        int ret = xmlSaveFile(VC_RUNTIME_INFO_FOREGROUND, doc);
        if (0 >= ret) {
-               SLOG(LOG_DEBUG, vc_config_tag(), "[ERROR] Fail to save foreground info : %d", ret);
+               SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Fail to save foreground info : %d", ret);
+               xmlFreeDoc(doc);
                return -1;
        }
        SLOG(LOG_DEBUG, vc_config_tag(), "[Success] Save foreground info pid(%d)", pid);
+       xmlFreeDoc(doc);
 
        return 0;
 }
index c4fc2d4..f46f80a 100644 (file)
@@ -109,7 +109,7 @@ int vc_cmd_parser_delete_file(int pid, vc_cmd_type_e type)
                if (APP_MANAGER_ERROR_NONE != ret) {
                        SLOG(LOG_ERROR, vc_info_tag(), "[ERROR] fail to get app id, ret(%d)", ret);
                } else {
-                       SLOG(LOG_ERROR, vc_info_tag(), "Background cmd: appid = %s", appid);
+                       SLOG(LOG_DEBUG, vc_info_tag(), "Background cmd: appid = %s", appid);
                }
        }
 
@@ -379,14 +379,14 @@ int vc_info_parser_get_nlu_result(char** nlu_result)
        int ret;
        ret = fscanf(fp, "size(%d)\n", &readn);
        if (ret <= 0) {
-               SLOG(LOG_DEBUG, vc_info_tag(), "[ERROR] Fail to get buffer size");
+               SLOG(LOG_ERROR, vc_info_tag(), "[ERROR] Fail to get buffer size");
                fclose(fp);
                return -1;
        }
 
        SLOG(LOG_DEBUG, vc_info_tag(), "[DEBUG] buffer size (%d)", readn);
        if (10000000 < readn || 0 > readn) {
-               SLOG(LOG_DEBUG, vc_info_tag(), "[ERROR] Invalid buffer size");
+               SLOG(LOG_ERROR, vc_info_tag(), "[ERROR] Invalid buffer size");
                fclose(fp);
                return -1;
        }
@@ -413,7 +413,7 @@ int vc_info_parser_get_result_pid_list(GSList** pid_list, const char* result)
 {
        int ret = vc_db_get_result_pid_list(result, pid_list);
        if (0 != ret) {
-               SLOG(LOG_DEBUG, vc_info_tag(), "[ERROR] Fail to delete result table");
+               SLOG(LOG_ERROR, vc_info_tag(), "[ERROR] Fail to delete result table");
                return -1;
        }
        return 0;
@@ -658,7 +658,7 @@ int __vc_cmd_parser_print_commands(GSList* cmd_list)
                cmd = iter->data;
 
                if (NULL == cmd) {
-                       SLOG(LOG_ERROR, vc_info_tag(), "[ERROR] NULL data from command list");
+                       SLOG(LOG_WARN, vc_info_tag(), "[WARNING] NULL data from command list");
                        iter = g_slist_next(iter);
                        continue;
                }
@@ -670,4 +670,4 @@ int __vc_cmd_parser_print_commands(GSList* cmd_list)
        }
 
        return 0;
-}
+}
\ No newline at end of file
index 748a607..8ab0e4f 100755 (executable)
@@ -206,7 +206,7 @@ static int __vc_json_set_commands(JsonObject *root_obj, int type, char* invocati
                                if (APP_MANAGER_ERROR_NONE != ret) {
                                        SLOG(LOG_ERROR, vc_json_tag(), "[ERROR] fail to get app id, ret(%d)", ret);
                                } else {
-                                       SLOG(LOG_ERROR, vc_json_tag(), "Background cmd: appid = %s", appid);
+                                       SLOG(LOG_DEBUG, vc_json_tag(), "Background cmd: appid = %s", appid);
                                }
                        } else {
                                appid = strdup(temp_text);
@@ -346,7 +346,7 @@ static int __vc_json_set_commands(JsonObject *root_obj, int type, char* invocati
                        }
                        return ret;
                }
-               SLOG(LOG_WARN, vc_json_tag(), "[INFO] pid(%d), type(%d), format(%d), domain(%d), cmd(%s), appid(%s)", cmd->pid, type, cmd->format, cmd->domain, cmd->command, cmd->appid);
+               SLOG(LOG_INFO, vc_json_tag(), "[INFO] pid(%d), type(%d), format(%d), domain(%d), cmd(%s), appid(%s)", cmd->pid, type, cmd->format, cmd->domain, cmd->command, cmd->appid);
 
                if (NULL != cmd->appid) {
                        free(cmd->appid);
@@ -469,5 +469,4 @@ int vc_json_set_all_commands_from_file(const char* file_path)
 
        g_object_unref(parser);
        return ret;
-}
-
+}
\ No newline at end of file
index 7787e21..112e13b 100644 (file)
@@ -242,18 +242,21 @@ static int __vcd_activate_app_by_appcontrol(const char* appid)
                ret = app_control_add_extra_data(app_control, "voice_launch", "get_result");
                if (APP_CONTROL_ERROR_NONE != ret) {
                        SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail to add extra data, ret(%d)", ret);
+                       app_control_destroy(app_control);
                        return VCD_ERROR_OPERATION_FAILED;
                }
                // Set an app ID.
                ret = app_control_set_app_id(app_control, appid);
                if (APP_CONTROL_ERROR_NONE != ret) {
                        SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail to set app id, ret(%d)", ret);
+                       app_control_destroy(app_control);
                        return VCD_ERROR_OPERATION_FAILED;
                }
                // Sent launch request
                ret = app_control_send_launch_request(app_control, NULL, NULL);
                if (APP_CONTROL_ERROR_NONE != ret) {
                        SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail to send launch request, ret(%d)", ret);
+                       app_control_destroy(app_control);
                        return VCD_ERROR_OPERATION_FAILED;
                }
                // Destroy app control