aboutsummaryrefslogtreecommitdiff
path: root/libsylph/procmsg.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-09-13 05:41:52 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-09-13 05:41:52 +0000
commitd7ea96a449049db7de8e92d135b1d961c523a351 (patch)
treeac14ce6a352fc29baeb03af5c9b8f75d76f349ab /libsylph/procmsg.c
parentd7a5fbadd02bc9e47459c6280cdfd20d18620803 (diff)
session.c: added extra error checking when writing to buffer.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1155 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/procmsg.c')
-rw-r--r--libsylph/procmsg.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libsylph/procmsg.c b/libsylph/procmsg.c
index 13141f50..37546154 100644
--- a/libsylph/procmsg.c
+++ b/libsylph/procmsg.c
@@ -156,10 +156,11 @@ gint procmsg_read_cache_data_str(FILE *fp, gchar **str)
#define READ_CACHE_DATA(data, fp) \
{ \
if (procmsg_read_cache_data_str(fp, &data) < 0) { \
+ g_warning("Cache data is corrupted\n"); \
procmsg_msginfo_free(msginfo); \
procmsg_msg_list_free(mlist); \
- mlist = NULL; \
- break; \
+ fclose(fp); \
+ return NULL; \
} \
}
@@ -171,8 +172,8 @@ gint procmsg_read_cache_data_str(FILE *fp, gchar **str)
g_warning("Cache data is corrupted\n"); \
procmsg_msginfo_free(msginfo); \
procmsg_msg_list_free(mlist); \
- mlist = NULL; \
- break; \
+ fclose(fp); \
+ return NULL; \
} else \
n = idata; \
}