From: wn.jang Date: Fri, 14 Jul 2023 04:01:54 +0000 (+0900) Subject: Fix build error on gcc-13 Build X-Git-Tag: accepted/tizen/unified/dev/20230726.120003^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=801dbaf53eb26fe6e26281448ff2b359359c8c2a;p=platform%2Fcore%2Fuifw%2Fvoice-control.git Fix build error on gcc-13 Build Change-Id: I43bd5da223ca1703e39e4c3e033f76d81680a4a7 --- diff --git a/client/vc_mgr_tidl.c b/client/vc_mgr_tidl.c index a4cec35..0037087 100644 --- a/client/vc_mgr_tidl.c +++ b/client/vc_mgr_tidl.c @@ -188,19 +188,20 @@ static void __notify_cb(void *user_data, bundle *msg) else if (0 == strncmp(VCD_MANAGER_METHOD_SET_PRIVATE_DATA, method, strlen(VCD_MANAGER_METHOD_SET_PRIVATE_DATA))) { SLOG(LOG_INFO, TAG_VCM, "@@@ Get request set private data"); - char* pid = NULL; + char* tmp_pid = NULL; char* key = NULL; char* private_data = NULL; - bundle_get_str(msg, VC_BUNDLE_PID, &pid); + bundle_get_str(msg, VC_BUNDLE_PID, &tmp_pid); bundle_get_str(msg, VC_BUNDLE_KEY, &key); bundle_get_str(msg, VC_BUNDLE_PRIVATE_DATA, &private_data); - SLOG(LOG_INFO, TAG_VCM, "@@ vc mgr get request set private data : pid(%d) ", atoi(pid)); + int pid = atoi(tmp_pid); + SLOG(LOG_INFO, TAG_VCM, "@@ vc mgr get request set private data : pid(%d) ", pid); if (pid > 0) { vc_mgr_core_send_private_data_set(key, private_data); } else { - SLOG(LOG_ERROR, TAG_VCM, "@@ got invalid pid(%d)", atoi(pid)); + SLOG(LOG_ERROR, TAG_VCM, "@@ got invalid pid(%d)", pid); } } /* VCD_MANAGER_METHOD_SET_PRIVATE_DATA */ diff --git a/common/vc_json_parser.c b/common/vc_json_parser.c index 3fc4eea..4c02835 100644 --- a/common/vc_json_parser.c +++ b/common/vc_json_parser.c @@ -50,15 +50,15 @@ static int __vc_json_get_invocation_name(const char* appid, char** invocation_na lang = NULL; return ret; } + free(lang); *invocation_name = strdup(temp_lable); if (NULL == *invocation_name) { SLOG(LOG_ERROR, vc_json_tag(), "[ERROR] Fail to allocate memory"); + free(temp_lable); + return VC_ERROR_OUT_OF_MEMORY; } free(temp_lable); - temp_lable = NULL; - free(lang); - lang = NULL; } SLOG(LOG_DEBUG, vc_json_tag(), "Get invocation name(%s)", *invocation_name);