aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/imap/camel-imap-summary.c17
-rw-r--r--camel/providers/local/camel-mbox-summary.c14
2 files changed, 17 insertions, 14 deletions
diff --git a/camel/providers/imap/camel-imap-summary.c b/camel/providers/imap/camel-imap-summary.c
index 74a024f760..66228649bc 100644
--- a/camel/providers/imap/camel-imap-summary.c
+++ b/camel/providers/imap/camel-imap-summary.c
@@ -169,20 +169,17 @@ message_info_load (CamelFolderSummary *s, FILE *in)
CamelImapMessageInfo *iinfo;
info = camel_imap_summary_parent->message_info_load (s, in);
- if (!info) {
- g_warning ("eek! encountered a NULL message info!");
- return NULL;
- }
- iinfo = (CamelImapMessageInfo *)info;
+ if (info) {
+ iinfo = (CamelImapMessageInfo *)info;
- if (camel_folder_summary_decode_uint32 (in, &iinfo->server_flags) == -1) {
- /* wouldn't it just be better to default to certain server flags here? */
- g_warning ("eek! problems decoding server flags!");
- camel_folder_summary_info_free (s, info);
- return NULL;
+ if (camel_folder_summary_decode_uint32 (in, &iinfo->server_flags) == -1)
+ goto error;
}
return info;
+error:
+ camel_folder_summary_info_free (s, info);
+ return NULL;
}
static int
diff --git a/camel/providers/local/camel-mbox-summary.c b/camel/providers/local/camel-mbox-summary.c
index 5b62743857..ab42e10df7 100644
--- a/camel/providers/local/camel-mbox-summary.c
+++ b/camel/providers/local/camel-mbox-summary.c
@@ -197,11 +197,15 @@ message_info_load(CamelFolderSummary *s, FILE *in)
mi = ((CamelFolderSummaryClass *)camel_mbox_summary_parent)->message_info_load(s, in);
if (mi) {
CamelMboxMessageInfo *mbi = (CamelMboxMessageInfo *)mi;
-
- camel_folder_summary_decode_off_t(in, &mbi->frompos);
+
+ if (camel_folder_summary_decode_off_t(in, &mbi->frompos) == -1)
+ goto error;
}
return mi;
+error:
+ camel_folder_summary_info_free(s, mi);
+ return NULL;
}
static int
@@ -211,9 +215,11 @@ message_info_save(CamelFolderSummary *s, FILE *out, CamelMessageInfo *mi)
io(printf("saving mbox message info\n"));
- ((CamelFolderSummaryClass *)camel_mbox_summary_parent)->message_info_save(s, out, mi);
+ if (((CamelFolderSummaryClass *)camel_mbox_summary_parent)->message_info_save(s, out, mi) == -1
+ || camel_folder_summary_encode_off_t(out, mbi->frompos) == -1)
+ return -1;
- return camel_folder_summary_encode_off_t(out, mbi->frompos);
+ return 0;
}
static int