Fix defects detected by static analysis tool 02/214302/1
authorJi-hoon Lee <dalton.lee@samsung.com>
Fri, 20 Sep 2019 04:56:44 +0000 (13:56 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Fri, 20 Sep 2019 04:56:44 +0000 (13:56 +0900)
Change-Id: I1c36170c38f070450b2470fd23f95df53c4136d0

src/multi_assistant_service.c

index 1c4eff05e065b1898e47f420e967c78902f6bd09..c05726d2b1e553491568ddbd6f2c42c279869d02 100644 (file)
@@ -168,7 +168,7 @@ bool check_preprocessing_assistant_exists()
        char* vconf_str = vconf_get_str(WAKEUP_SETTINGS_KEY_PREPROCESSING_ASSISTANT_APPID);
        if (vconf_str) {
                for (int loop = 0; loop < MAX_MACLIENT_INFO_NUM; loop++) {
-                       if (g_maclient_info[loop].used && g_maclient_info[loop].appid) {
+                       if (g_maclient_info[loop].used) {
                                if (strncmp(vconf_str, g_maclient_info[loop].appid, MAX_APPID_LEN) == 0) {
                                        ret = true;
                                }
@@ -452,8 +452,8 @@ int mas_client_set_preprocessing_allow_mode(int pid, int mode, const char* appid
        }
 
        for (int loop = 0; loop < MAX_MACLIENT_INFO_NUM; loop++) {
-               if (g_maclient_info[loop].used && g_maclient_info[loop].appid) {
-                       if (strncmp(pid_appid, g_maclient_info[loop].appid, MAX_APPID_LEN) == 0) {
+               if (g_maclient_info[loop].used) {
+                       if (pid_appid && strncmp(pid_appid, g_maclient_info[loop].appid, MAX_APPID_LEN) == 0) {
                                g_maclient_info[loop].preprocessing_allow_mode = mode;
                                strncpy(g_maclient_info[loop].preprocessing_allow_appid, appid, MAX_APPID_LEN);
                                g_maclient_info[loop].preprocessing_allow_appid[MAX_APPID_LEN - 1] = '\0';
@@ -1018,7 +1018,7 @@ int mas_process_voice_key_event(bool pressed)
 ma_preprocessing_allow_mode_e get_preprocessing_allow_mode(const char* appid)
 {
        for (int loop = 0; loop < MAX_MACLIENT_INFO_NUM; loop++) {
-               if (g_maclient_info[loop].used && g_maclient_info[loop].appid) {
+               if (g_maclient_info[loop].used) {
                        if (strncmp(appid, g_maclient_info[loop].appid, MAX_APPID_LEN) == 0) {
                                return g_maclient_info[loop].preprocessing_allow_mode;
                        }