fix svace issue 99/68999/2 accepted/tizen/common/20160524.150414 accepted/tizen/ivi/20160524.094818 accepted/tizen/mobile/20160524.094713 accepted/tizen/wearable/20160524.094900 submit/tizen/20160524.011323
authorintae, jeon <intae.jeon@samsung.com>
Wed, 11 May 2016 05:14:01 +0000 (14:14 +0900)
committerintae, jeon <intae.jeon@samsung.com>
Wed, 11 May 2016 10:25:36 +0000 (19:25 +0900)
Change-Id: I3e94f159600de1e67332c1deed0bd338aae8e921
Signed-off-by: intae, jeon <intae.jeon@samsung.com>
email-core/email-core-event.c
email-core/email-core-utils.c

index 0b30645..327f17d 100755 (executable)
@@ -1416,8 +1416,13 @@ INTERNAL_FUNC int emcore_get_task_information(email_task_information_t **output_
 
        for (i = 0; i < q_length; i++) {
                elm = (email_event_t *)g_queue_peek_nth(g_event_que, i);
+               if (!elm){
+                       EM_DEBUG_EXCEPTION("EMAIL_ERROR_DATA_NOT_FOUND");
+                       err = EMAIL_ERROR_DATA_NOT_FOUND;
+                       goto FINISH_OFF;
+               }
                if(elm->type != EMAIL_EVENT_DOWNLOAD_ATTACHMENT) {
-                       if (elm && (elm->type != EMAIL_EVENT_NONE && elm->status != EMAIL_EVENT_STATUS_CANCELED)) {
+                       if (elm->type != EMAIL_EVENT_NONE && elm->status != EMAIL_EVENT_STATUS_CANCELED) {
                                task_information[index].handle     = elm->handle;
                                task_information[index].account_id = elm->account_id;
                                task_information[index].type       = elm->type;
@@ -1429,7 +1434,7 @@ INTERNAL_FUNC int emcore_get_task_information(email_task_information_t **output_
 
                        }
                }else if(elm->type == EMAIL_EVENT_DOWNLOAD_ATTACHMENT) {
-                       if (elm && (elm->type != EMAIL_EVENT_NONE && elm->status != EMAIL_EVENT_STATUS_CANCELED)) {
+                       if (elm->type != EMAIL_EVENT_NONE && elm->status != EMAIL_EVENT_STATUS_CANCELED) {
 
                                task_information[index].task_data1 = (void *)elm->event_param_data_4; /* mail_id */
                                task_information[index].task_data2 = (void *)elm->event_param_data_5; /* attachment_nth */
index 7c0af9c..21aa1f7 100755 (executable)
@@ -2151,8 +2151,8 @@ char *emcore_get_alias_of_mailbox(const char *mailbox_path)
 
        if (token_list == NULL) {
                EM_DEBUG_LOG("g_strsplit_set failed.");
-        if (mailbox)
-            g_free(mailbox);
+            if (mailbox)
+                   g_free(mailbox);
 
                return NULL;
        }
@@ -2164,12 +2164,9 @@ char *emcore_get_alias_of_mailbox(const char *mailbox_path)
                index++;
 
        name = g_strdup(token_list[index - 1]);
-       if (!name) /* prevent 27459 */ {
-        if (mailbox)
-            g_free(mailbox);
-
+       if (!name) {
                return NULL;
-    }
+        }
 
        g_strfreev(token_list);