if (g_mime_content_type_is_type (type, "text", "html") || g_mime_content_type_is_type (type, "text", "xhtml")) {
msg_debug ("mime_foreach_callback: got urls from text/html part");
- text_part = memory_pool_alloc (task->task_pool, sizeof (struct mime_text_part));
+ text_part = memory_pool_alloc0 (task->task_pool, sizeof (struct mime_text_part));
text_part->is_html = TRUE;
if (is_empty) {
text_part->is_empty = TRUE;
else if (g_mime_content_type_is_type (type, "text", "plain")) {
msg_debug ("mime_foreach_callback: got urls from text/plain part");
- text_part = memory_pool_alloc (task->task_pool, sizeof (struct mime_text_part));
+ text_part = memory_pool_alloc0 (task->task_pool, sizeof (struct mime_text_part));
text_part->is_html = FALSE;
if (is_empty) {
text_part->is_empty = TRUE;
while (cur) {
part = cur->data;
+ if (part->is_empty) {
+ cur = g_list_next (cur);
+ continue;
+ }
+
rc = g_regex_match_full (email_module_ctx->email_re, (const char *)part->orig->data, part->orig->len, 0, 0, &info, &err);
if (rc) {
while (g_match_info_matches (info)) {