}
email_event_t *first = g_queue_peek_nth(g_event_que, 0);
+ if (first == NULL) EM_DEBUG_EXCEPTION("Queue size zero");
if (is_sync_mail_flag_event && first->type == EMAIL_EVENT_SYNC_HEADER) {
// copy sync event and push to event queue
email_event_t *sync_event = em_malloc(sizeof(email_event_t));
+ if (sync_event == NULL) {
+ EM_DEBUG_EXCEPTION("em_malloc failed");
+ }
memcpy(sync_event, first, sizeof(email_event_t));
sync_event->multi_user_name = g_strdup(first->multi_user_name);
sync_event->event_param_data_1 = g_strdup(first->event_param_data_1);
/* parse the message from the stream */
message = g_mime_parser_construct_message(parser);
+ if (message == NULL){
+ testapp_print("g_mime_parser_construct_message error");
+ return FALSE;
+ }
/* free the parser (and the stream) */
g_object_unref(parser);