From ae589a1006466158bc1a8a0e690b4ac1001b3186 Mon Sep 17 00:00:00 2001 From: "intae, jeon" Date: Wed, 11 May 2016 14:14:01 +0900 Subject: [PATCH] fix svace issue Change-Id: I3e94f159600de1e67332c1deed0bd338aae8e921 Signed-off-by: intae, jeon --- email-core/email-core-event.c | 9 +++++++-- email-core/email-core-utils.c | 11 ++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/email-core/email-core-event.c b/email-core/email-core-event.c index 0b30645..327f17d 100755 --- a/email-core/email-core-event.c +++ b/email-core/email-core-event.c @@ -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 */ diff --git a/email-core/email-core-utils.c b/email-core/email-core-utils.c index 7c0af9c..21aa1f7 100755 --- a/email-core/email-core-utils.c +++ b/email-core/email-core-utils.c @@ -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); -- 2.7.4